Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

ok guys heres the story, you may have seen my code i added for the ScreenShot script Screenshot, well that weas the easy code, now i find myself stuck. i wanna make a simple perl script that will grab my screen and name it "Shot_date goes here.jpg" but i find myself getting annoyd, im running FreeBSD. the command for the filename i want would be something like this "date +%d-%m-%y_%H%M%S"

any help would be great

20050620 Janitored by Corion: Linkified link, added formatting

Replies are listed 'Best First'.
Re: Help With ScreenShot Script
by dorward (Curate) on Jun 20, 2005 at 09:39 UTC
Re: Help With ScreenShot Script
by Fletch (Bishop) on Jun 20, 2005 at 11:54 UTC

    Or POSIX::strftime which will take the same format specifiers.

    --
    We're looking for people in ATL

Re: Help With ScreenShot Script
by zentara (Cardinal) on Jun 20, 2005 at 12:46 UTC
    Why call Perl up for such a simple task, when you already have a shell started?
    #!/bin/sh import -window root /home/zentara/`date +%d%b%y%H%M%S`.jpg

    I'm not really a human, but I play one on earth. flash japh
Re: Help With ScreenShot Script
by aukjan (Friar) on Jun 20, 2005 at 09:47 UTC
    Or try localtime

    .:| If it can't be fixed .. Don't break it |:.

Re: Help With ScreenShot Script
by Anonymous Monk on Jun 21, 2005 at 06:00 UTC
    i have tried running it like that before, i get filnames such as "Shot-date +0-m-y_HM" i dunno why it does this, but thats why im useing perl to run it