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: Filename modification
> 
> 
> 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]
> 
> 


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


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

Reply via email to