http://qs321.pair.com?node_id=957430

uksza has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

What's wrong with this code?
#!/usr/bin/perl use Modern::Perl; while (<DATA>) { chomp; &read($_); } sub read() { my $path = shift; if ( $path =~ m?^.*/home/(.*)/\.forward? ) { say "i've got >$1<"; } else { say "ups >$path<"; } } __DATA__ /home/aaa/.forward /home/bbb/.forward /home/ccc/.forward /home/ddd/.forward
and I have:
i've got >aaa< ups >/home/bbb/.forward< ups >/home/ccc/.forward< ups >/home/ddd/.forward<