I am new to perl so I need some help from the list with this script. It
takes a value from command line and then returns afters processing.
For example, If value is "c:\projects\test 2005.txt" the script will returns
it as "test" (actually omitts any space in the directory or file name) while
I want the full name of the file regardless of any space in the directory or
filename.
how can I get the value "test 2005.txt"?

  #!/usr/bin/perl
  # file: basename.pl
  use strict;
  use File::Basename;
  my $path = $ARGV[0];
  my $base = basename($path);
  my $dir  = dirname($path);
  print STDOUT $base;


any help will be greatly appreciated.

Thanks in advance.





-- 
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