> ($filename,$fileExtention)=fileparse($moofile, '\..*');
> open (OUTFILE1, ">$filename_TEMP.LOG");
>
Perl thinks you are trying to access a variable named
$filename_TEMP. What you want to say is
open( OUTFILE1, ">${filename}_TEMP.LOG" );
HTH,
Tanton
--
To unsubscribe, e-mail: [EMAIL PROTEC
Henry Wong wrote:
>
> Actually, my code is something like this:
>
> print "\n\n\nPLEASE ENTER REQUIRED .LOG FILE:";
> $file = ;
> chomp ($file);
> open (INFILE1, "$file");
>
> So how can I use the $file variable to be splitted from its *.log and then
> subsequently using it for appending to a "
z "$filename", the filename comes out smoothly. Pls advise?
Regards,
~ HENRY WONG ~
- Original Message -
From: "NYIMI Jose (BMB)" <[EMAIL PROTECTED]>
To: "Henry Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, S
On Mon, 23 Sep 2002, Henry Wong wrote:
> Actually, my code is something like this:
>
> print "\n\n\nPLEASE ENTER REQUIRED .LOG FILE:";
> $file = ;
> chomp ($file);
> open (INFILE1, "$file");
>
> So how can I use the $file variable to be splitted from its *.log and then
> subsequently using it f
Give a look to File::Basename module.
http://search.cpan.org/author/JHI/perl-5.8.0/lib/File/Basename.pm
José.
> -Original Message-
> From: Henry Wong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 9:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Filena
al Message -
From: "Dharmender Rai" <[EMAIL PROTECTED]>
To: "Henry Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, September 23, 2002 2:53 PM
Subject: Re: Filename modification
> Read the name of the file from STDIN. Assign it to
> som
Read the name of the file from STDIN. Assign it to
some scalar variable. Using that variable, you can
open this file. You can have other scalar variable
that can be assigned the name of this file appended
with whatever you want (like "_temp" etc) and eiher
open it (if it is there) or create it.
Hi all, a simple question...
How to do a coding that takes in your filename and then using that filename
for further uses?
E.g. user is asked to enter a filename. User enters REX.log. Program will
then use the name REX.log for future file extension/usage by creating
various REX files like REX_tem