sivga wrote:
> while ($line = <AG>) {
>
> if ($line =~ /stock[ ]+([99999])*/ ) {
if ( $line =~ /stock.+\b99999\b/ ) {
> print " The stock is $line";
> $line =~ s/stock[ ]+([99999])*/stock[ ]+([77777])*/;
$line =~ s/\b99999\b/77777/;
Where did you get the idea of using square brackets that way?
Have you seen the extensive Perl documentation on regular expressions?
perldoc perlrequick
perldoc perlreref
perldoc perlretut
perldoc perlre
--
Gunnar Hjalmarsson
Email:
http://www.gunnar.cc/cgi-bin/contact.pl