[HoustonTx.pm] Perl/Unix contract in Houston

houston at mail.pm.org houston at mail.pm.org
Thu Aug 7 11:43:47 CDT 2003


Dunno about dumping the contents into a scalar in less than that (that code
below doesnt work for me anyway) but to slurp all files listed in @ARGV to an
array you can easily do : 

	for(@ARGV){@c = map$_,<>};

Then of course you could always : my $contents = "@c";

I wanna keep looking into the one below though, because it gives me file not
found.

On Thu, Aug 07, 2003 at 11:02:49AM -0500, houston at mail.pm.org wrote:
> Ditto. And in the spirit of keeping the board from becoming job postings 
> only, here's a little thingie I recently ran across to slurp a file into a 
> scalar:
> 
> my $file_contents=do {local(@ARGV,$/)=$filename; <>};
> 
> 
> Anyone care to pick it apart and describe what it's doing? Better yet, can 
> anyone golf it (aside from making the names shorter)?
> 
> 
> Vince
> 
> 
> houston at mail.pm.org wrote:
> >Keep the jobs coming :) I already have a fine job, but I also enjoy 
> >seeing what's out there. However, I'd hate to see this site turned into 
> >a job board.
> >
> >-Will
> >
> >----Original Message Follows----
> >From: houston at mail.pm.org
> >Reply-To: houston at mail.pm.org
> >To: houston at mail.pm.org
> >Subject: Re: [HoustonTx.pm] Perl/Unix contract in Houston
> >Date: Thu, 7 Aug 2003 08:38:13 -0700 (PDT)
> >
> >PerlMongers,
> >  How do you feel about posts to the list of this nature?  My thought
> >is that it would benefit us all in this economy, but I am willing to be
> >overruled.
> >
> >Thank you,
> >Kristofer Hoch.
> >
> >=====
> >-----BEGIN GEEK CODE BLOCK-----
> >Version: 3.12
> >GIT d s+:++ a C++ UL++ US+ P+++ L++
> >W+++ w PS PE t++ b+ G e r+++ z++++
> >------END GEEK CODE BLOCK------



More information about the Houston mailing list