Here's the problem:
My input looks like the following:
C:\Perl\scripts\shots\sp2\shot_1\dir.txt
C:\Perl\scripts\shots\sp2\shot_1\drames.txt
C:\Perl\scripts\shots\sp2\shot_1\filename.0001.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0002.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0003.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0004.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0005.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0006.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0007.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0008.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0009.cin
C:\Perl\scripts\shots\sp2\shot_1\filename.0010.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0001.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0002.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0003.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0004.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0005.cin
C:\Perl\scripts\shots\sp2\shot_1\framename.0006.cin
C:\Perl\scripts\shots\sp2\shot_1\lss
C:\Perl\scripts\shots\sp2\shot_1\lss_orig
C:\Perl\scripts\shots\sp2\shot_1\shotname.0001.cin
C:\Perl\scripts\shots\sp2\shot_1\shotname.0002.cin
C:\Perl\scripts\shots\sp2\shot_1\shotname.0003.cin
C:\Perl\scripts\shots\sp2\shot_1\shotname.0004.cin
C:\Perl\scripts\shots\sp2\shot_1\shotname.0005.cin
C:\Perl\scripts\shots\sp2\shot_1\sub_directory
C:\Perl\scripts\shots\sp2\shot_1\test
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0001.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0002.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0003.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0004.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0005.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0006.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0007.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0008.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0009.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0010.rgb
I want my output from the subroutine to look like the
following:
filename
filename
filename
filename
filename
filename
filename
filename
filename
filename
framename
framename
framename
framename
framename
framename
shotname
shotname
shotname
shotname
shotname
basename
basename
basename
basename
basename
basename
basename
basename
basename
basename
The following is the code:
#!/usr/bin/perl -w
use strict;
my @paths = `dir /b/s`; # print
@paths;
my @basenames = &basenames(@paths);
sub basenames {
foreach (@_) {
if ($_ =~ /(\w+)\.\d+\.\w+$/) {
@basenames = $1; # print
"@basenames\n";
}
}
}
Everything looks OK when I do the test prints. But,
I'm not getting output from the subroutine. What's the
correct way to get this return? The OS is Window$.
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>