[26497] in Perl-Users-Digest
Perl-Users Digest, Issue: 8657 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 12 03:05:43 2005
Date: Sat, 12 Nov 2005 00:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 12 Nov 2005 Volume: 10 Number: 8657
Today's topics:
Re: from text file to array in shortest way <sdn.girths00869@zoemail.net>
Re: using perl to print yesterday's date, but with form <sdn.girths00869@zoemail.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Nov 2005 21:40:54 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: from text file to array in shortest way
Message-Id: <Xns970BE6F0FCF48sdn.comcast@216.196.97.136>
ngoc <ngoc@yahoo.com> wrote in news:436fc98d$1@news.broadpark.no:
> my @books_array = ();
> open(FILE, '<books_file.txt') or croak 'Can open file';
> while (<FILE>){
> push @books_array, $_;
> }
> Other shorter ways than above?
use Tie::File;
tie my @books_array, 'books_file.txt' or die "Can't open: $!";
--
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`
------------------------------
Date: Fri, 11 Nov 2005 21:01:09 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: using perl to print yesterday's date, but with formatting options ?
Message-Id: <Xns970BE027D12C7sdn.comcast@216.196.97.136>
"Tom Van Overbeke" <tomvo@hahaha.be> wrote in
news:dk5ime$6le$1@pop-news.nl.colt.net:
> Hi,
>
> I need a way to use yesterday's date in a variable. The tricks with
> 'date' don't work on my system, but perl does.
>
> so i've got:
> perl -le 'print scalar localtime time - 86400' which outputs:
> Sun Oct 30 17:56:52 2005
>
> But the format I need is: 30.10.05
>
> Any ideas on how to add this to the above piece of code ?
It doesn't get much simpler than:
use Time::Format;
print "Yesterday was $time{'dd.mm.yy', time-86400}\n"
--
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8657
***************************************