Jean Padilla <[EMAIL PROTECTED]> wrote:
> Hi, pravesh
> 1 - You are saying "mv <<somefile /home/pravesh" !
> 2 - a file handle is *not* to be confused with a file name

Actually - Perl will let you do

  our $FH = 'path';
  open FH or die...;  # open FH, '<', $FH

Doesn't work with 'my' variables, though.

> try :
> 
> my $file_name = "somefile";
> open(FILE_HANDLE, $file_name) or die ...
> ...
> your 'move' is now
> 
> `mv $file_name /home/pravesh`;

And now you can do:

  `mv $FH /home/pravesh`;

The whole thing would be better written:

  #!/usr/bin/perl
  use warnings;
  use File::Copy;

  my $path = 'somefile';
  open FH, $path  or die "open: $path: $!";
  ...

  move $path, '/home/pravesh' 
    or die "move: $path => /home/pravesh: $!"

-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to