Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Creating Filenames using variables

by zigster (Hermit)
on Feb 08, 2001 at 16:15 UTC ( [id://57164]=note: print w/replies, xml ) Need Help??


in reply to Creating Filenames using variables

Use '.' string concatination
$filename = $mon . "_" . $date;
HTH
Update To be honest tho you would probs be best off using shell, checkout rename(1) if you are using linux you may find it easier.
--

Zigster

Replies are listed 'Best First'.
Re: Re: Creating Filenames using variables
by magnus (Pilgrim) on Feb 08, 2001 at 16:28 UTC
    Zigster that would get you MON.DOC_$date

    rass, you can try this... i just did and it works... careful of the trailing  \n on the date...
    $mon = "MON.DOC"; @name = split (/\./,$mon); $date = `date`; #(or whatever) $filename = $name[0] . "_" . $date . "." . $name[1];


    magnus
      Dowt, more hast less speed required on my part next time.. Thanks for the correction you are of course quite correct.
      --

      Zigster
      Nice catch magnus (and now you have your own manoeuver ;-), but I just wanted to point out the potential problem of filenames with multiple dots. There are plenty even on this Win32 box.

      --
      I'd like to be able to assign to an luser

        coolbeans... i've never had my own manoeuver before...

        does it come with leather bucket seats you think?

        probably not, but at least it's got Perlmonk conditioning... =)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found