PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:
when I run my script, I get the error:my $mail_date = $ARGV[0]; my $row = 0; my $col = 0; $xWS->write($row,$col++,$_) for @{$sth->{NAME}}; my $name = @{$sth->{NAME}} =~ /\/.*/; while (my $ar = $sth->fetchrow_arrayref) { s{^.*/}{} for @$ar; # this regex thanks to perlmonks ++$row, $col = 0; $xWS->write($row,$col++,$_) for @$ar, $mail_date; } $xWB->close(); print $name;
For now, I was trying to match anything after the forward slash to see if it worked. But in actuality, I want to match for whole word after the forward slash. I think this can be done with \wApplying pattern match (m//) to @array will act on scalar(@array) at ( +my script name)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: match expression from query
by hdb (Monsignor) on Sep 19, 2013 at 18:45 UTC | |
by PerlSufi (Friar) on Sep 19, 2013 at 19:19 UTC | |
|
Re: match expression from query
by CountZero (Bishop) on Sep 19, 2013 at 19:12 UTC | |
by Anonymous Monk on Sep 20, 2013 at 01:07 UTC | |
by PerlSufi (Friar) on Sep 19, 2013 at 19:16 UTC |