004
02.10.2007, 15:17 Uhr
J-jayz-Z
Perl Crack ala Carte (Operator)
|
Na ja, find verwenden?!
C++: |
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <iterator>
int main(int argc, char* argv[]) { std::vector<std::string> vec; vec.push_back("test1"); vec.push_back("test2"); vec.push_back("test3"); std::copy(vec.begin(), vec.end(), std::ostream_iterator<std::string>(std::cout, "\n")); vec.erase(std::find(vec.begin(), vec.end(), "test3")); std::copy(vec.begin(), vec.end(), std::ostream_iterator<std::string>(std::cout, "\n")); return EXIT_SUCCESS; }
|
-- perl -Mstrict -Mwarnings -e 'package blub; sub new { bless {} } sub bar {my $self=shift; $self->{bla}="66756e2d736f66742e6465"; return $self->{bla};} my $foo=blub->new();print "Hallo ";print pack("H*",$foo->bar()); print "\n"' |