chen li wrote:
#!/usr/bin/perl
use warnings;
use strict;

 my $string="password=xyz verbose=9 score=0";
 my @keys=();
 my @values=();
 while ($string=~/(\w+)=(\w+)/g){

  @keys=push(@keys, $1);

  push @keys, $1;

  print $1, "\n";
  @values=push(@values,$2);

  push @values, $2;

  print $2, "\n";
 }
print "\nThese are the keys:","@keys";

print "\nThese are the values:","@values","\n";
exit;

__END__

See `perldoc -f push` for details, especially the part about the returned value.


--

Just my 0.00000002 million dollars worth,
   --- Shawn

"Probability is now one. Any problems that are left are your own."
   SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is available at http://perldoc.perl.org/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to