Actually, my code is something like this:

print "\n\n\nPLEASE ENTER REQUIRED .LOG FILE:";
$file = <STDIN>;
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 "$file_temp.txt" format? Coz when i
print the $file, it gives me "xxx.log", which i actually want. But i only
want the front portion "xxx" and not the ".log" later when i create new
files like 'xxx_temp.txt'. Pls advise, thanks.


Regards,

~ HENRY WONG ~

----- Original 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
> 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.
>
>    Read about "open" and "close" functions.
>
>
>
>  --- Henry Wong <[EMAIL PROTECTED]> wrote: > 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_temp.txt, REX_data.log,
> > REX_arranged.log,etc
> > ,etc... in other words, how do i make the <STDIN> to
> > be dynamic so that my
> > program can use the input filenames for file
> > saving/modification/etc?
> >
> >
> > Regards,
> >
> > ~ HENRY WONG ~
> >
> >
> > This e-mail is intended only for the named
> > addressee(s) and may contain confidential and/or
> > privileged information. If you are not the named
> > addressee (or have received this e-mail in error),
> > please notify the sender immediately and destroy
> > this e-mail. The unauthorised use, disclosure,
> > distribution or copying of the contents in this
> > e-mail is strictly prohibited."
> >
> > --
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

This e-mail is intended only for the named addressee(s) and may contain confidential 
and/or privileged information. If you are not the named addressee (or have received 
this e-mail in error), please notify the sender immediately and destroy this e-mail. 
The unauthorised use, disclosure, distribution or copying of the contents in this 
e-mail is strictly prohibited."

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

Reply via email to