[25164] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7413 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 17 11:05:45 2004

Date: Wed, 17 Nov 2004 08:05:09 -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           Wed, 17 Nov 2004     Volume: 10 Number: 7413

Today's topics:
        Adding a unique user name in a file <sam.wun@authtec.net>
    Re: Array -> Reference to Hash of Arrays <mritty@gmail.com>
    Re: First Perl Program <bik.mido@tiscalinet.it>
    Re: How to work (?{code}) <admin@asarian-host.net>
    Re: perldoc problem on linux (Zhiliang Hu)
    Re: perldoc problem on linux <jwillmore@fastmail.us>
    Re: regexp question (jonathan adams)
        Save excel including embedded Formulas, Comments etc. (qazmlp)
    Re: Save excel including embedded Formulas, Comments et <1usa@llenroc.ude.invalid>
    Re: Search for string and return file name <bik.mido@tiscalinet.it>
    Re: Search for string and return file name <toreau@gmail.com>
        Server side redirection (brijesh)
    Re: Server side redirection (Anno Siegel)
    Re: Server side redirection <noreply@gunnar.cc>
    Re: Server side redirection <tadmc@augustmail.com>
        spam assassin - running <razorjack@hihi.gazeta.pl>
    Re: texdoctk error: "No selection was made" <bik.mido@tiscalinet.it>
        the antichomp (wana)
    Re: the antichomp <1usa@llenroc.ude.invalid>
    Re: the antichomp <uri@stemsystems.com>
    Re: the antichomp <uri@stemsystems.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 17 Nov 2004 23:27:08 +0800
From: sam <sam.wun@authtec.net>
Subject: Adding a unique user name in a file
Message-Id: <cnfs5r$2dkq$1@news.hgc.com.hk>

Hi,

Is there any perl module I can use to read in a list of user names from 
a file and do a binary search on the list base on the user name, if the 
user name is not found, add this user name to the file?

Thanks
Sam


------------------------------

Date: Wed, 17 Nov 2004 14:36:13 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Array -> Reference to Hash of Arrays
Message-Id: <xlJmd.12065$tI3.2536@trndny01>

"Tom" <sudhirx@gmail.com> wrote in message
news:f50c52fa.0411162200.65b4846b@posting.google.com...
> Thanks thats a lot of information.
> perldoc perldsc was quite useful.
>
> Is it possible to store "AoA" - Array of Array as value to a hash key?
>
> Array -> AoH -> AoA
>
> I have an array and the individual element points to an element(in
AoH).
> Value of the hash key would be an AoA.
> I'm trying this at my end. And would appreciate comments on this.

Please do not top-post.  That is, please post your reply *below* what
you are replying to.  Thank you.

You can create data structures with arbitrarily large dimensions.   Like
all multi-dimensional arrays, you cannot store an actual array, but you
instead store a reference to an array in your larger structure.

Thus, to create a Hash of Array of Arrays:

my %HoAoA = (                          #the overall hash
     foo => [                          #value of hash at key 'foo'
                                       #is an anonymous arrayref
                 [ 1, 2, 3, 4,],       #first elem of this array is
                                       #an anonymous array ref
                 [ 'a','b','c','d'],   #etc . . .
            ],
     bar => [
                 [ 10..14],
                 [ 'w'..'z'],
            ],
);


Using this structure:

%HoAoA is the entire Hash.
$HoAoA{foo} is a reference to an array of arrays
@{$HoAoA{foo}} is an array containing two array references
$HoAoA{foo}[0] is a reference to an array
@{$HoAoA{foo}[0]} is an array containing (1, 2, 3, 4)
$HoAoA{foo}[0][0] is the number 1

The standard module Data::Dumper is invaluable in figuring out exactly
what your structure looks like.

Hope this helps,
Paul Lalli



------------------------------

Date: Wed, 17 Nov 2004 14:15:28 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: First Perl Program
Message-Id: <lhhmp09f1851iud5ir24mm0in39mvptre9@4ax.com>

On 16 Nov 2004 13:04:41 -0800, parkerdg@gmail.com (DGP) wrote:

>I decided Perl was the best tool for the job. After reading a begginer
>Perl book, I was able to complete the program below within a few
>hours. I think this speaks to Perl's ease of use, power, and

I see that your post has been duly commented, and it doesn't seem to
me that I'd have anything to add. As an overall cmt, though, let me
tell you that as a "First Perl Program" this is fairly good. You
should really see the kind of crap some people post here...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Wed, 17 Nov 2004 15:06:07 +0100
From: "Mark" <admin@asarian-host.net>
Subject: Re: How to work (?{code})
Message-Id: <JPidndifMP1axwbcRVn-1w@giganews.com>

"Brian McCauley" <nobull@mail.com> wrote in message 
news:cncvhl$brg$1@sun3.bham.ac.uk...

Thank you for your reply (more below).

>> You are missing a question mark.  :-)
>>
>> You want  (?? { code })  rather than  (? { code }).
>
> Surely the OP really wants the hideous but widely used idiom:
>
> (?? { (code) ? '' : '(?!)' })

What does this do? "If code returns true, return '', else ..."?

I tried the following:

$domain = 'example.com';

if ($domain =~ /(??{mysql_call (4, 1)})$/i) {
    print "Yes: $domain, $^R, $&\n";
}

And I got a core-dump! (see Devel::CoreStack output below). Obviously, this 
stuff is indeed experimental. :)

Thanks,

- Mark


--------
This GDB was configured as "i386-unknown-freebsd"...(no debugging symbols 
found)...
Core was generated by `perl'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so...
(no debugging symbols found)...done.
Reading symbols from /usr/lib/libm.so.2...(no debugging symbols 
found)...done.
Reading symbols from /usr/lib/libcrypt.so.2...(no debugging symbols 
found)...done.
Reading symbols from /usr/lib/libutil.so.3...(no debugging symbols 
found)...done.
Reading symbols from /usr/lib/libc_r.so.4...(no debugging symbols 
found)...done.
Reading symbols from 
/usr/local/perl-with-ithreads/lib/perl5/site_perl/5.8.5/mach/auto/DBI/DBI.so...(no 
debugging symbols found)...done.
Reading symbols from 
/usr/local/perl-with-ithreads/lib/perl5/site_perl/5.8.5/mach/auto/DBD/mysql/mysql.so...(no 
debugging symbols found)...done.
Reading symbols from /usr/lib/libz.so.2...(no debugging symbols 
found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols 
found)...done.
#0  0x281316d9 in S_regmatch () from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
(gdb) #0  0x281316d9 in S_regmatch () from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#1  0x2812f865 in S_regtry () from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#2  0x2812f35c in Perl_regexec_flags ()
   from /usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#3  0x280e0b3b in Perl_pp_match ()
   from /usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#4  0x280dd9a1 in Perl_runops_standard ()
   from /usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#5  0x280897b9 in S_run_body () from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#6  0x28089474 in perl_run () from 
/usr/local/perl-with-ithreads/lib/perl5/5.8.5/mach/CORE/libperl.so
#7  0x8048f7e in main ()
#8  0x8048e3e in _start () 




------------------------------

Date: 17 Nov 2004 06:21:50 -0800
From: zhilianghu@yahoo.com (Zhiliang Hu)
Subject: Re: perldoc problem on linux
Message-Id: <1daf0582.0411170621.ff934cc@posting.google.com>

James Willmore's suggestion works: "perldoc -t WWW::Search | less" --
Returns normal ducumentation.  However, without "less" it still
returns nothing except login prompt (i.e. "perldoc -t WWW::Search").

I don't seem to comprehend where the problem is (is "pager" a utility
to dispaly text like "less"/"more"?), could you suggest further?

Thanks and with best regards,

Zhiliang


anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<cn065m$f3q$1@mamenchi.zrz.TU-Berlin.DE>...
> James Willmore  <jwillmore@fastmail.us> wrote in comp.lang.perl.misc:
> > On Thu, 11 Nov 2004 12:44:27 +0000, Anno Siegel wrote:
> > 
> > > James Willmore  <jwillmore@fastmail.us> wrote in comp.lang.perl.misc:
> > >> On Wed, 10 Nov 2004 13:30:34 -0800, Zhiliang Hu wrote:
> > >> 
> > >> <snip>
> > >> > Yes, I did - 'perldoc' is in /usr/local/bin/ and it is in both my and
> > >> > ~root's path.  (I double checked them and I still got the same as
> > >> > before).
> > >> > 
> > >> > Following commands work fine:
> > >> >  > perloc -V
> > >> >  > perldoc -h
> > >> >  > perldoc NONEexist    (this returns "No documentation found")
> > >> >  > perldoc -l WWW::Search
> > >> > 
> > >> > but "perldoc WWW::Search" will show nothing but login prompts.
> > >> 
> > >> As a "quick fix", you could (since you're on a *nix box) try:
> > >> perldoc -t WWW::Search | less
> > >> 
> > >> If this works, then you can at least use perldoc until you hunt down the
> > >> cause of the problem.
> > > 
> > > What makes you think "perldoc -t" would work?  My guess is it's a
> > > permission problem that doesn't exist for root.
> > 
> > I took it the poster at his word that the only thing he couldn't do was
> > view the documentation.  I was under the impression that if you try to run
> > perldoc as root, then it would always issue an error message about it
> > being unsafe to run as root - regardless of what option.  The error
> > mentioned in the OP was he tried to run perldoc to view documentation and
> > got nothing.
> 
> I see.  However, OP said it works for him(?) as root, but not as an
> ordinary user.  In such a case, I tend to check permissions first.
> 
> Otherwise I believe perldoc is root-safe now and the warning is gone.
> (Yup, v3.13 is fine with root)
> 
> In any case, someone (Sean Burke, to give credit where credit is due)
> has done a tremendous job of cleaning up the code.  Perldoc used to be
> a horror of a script -- I remember I tried to fix something minor once,
> but had to give up because I couldn't make sure in reasonable time
> that the fix wouldn't break something else.  When I looked at it last
> night I found a well-organized program, neatly divided up in modules.
> It would be a joy to fix if I knew of anything that needed fixing.
> 
> > I agree that it might be a permission problem ... OTOH, if it's working
> > for an unprivileged user, it might be the pager setting for root. Trying
> > to run perldoc with the -t option might (dis)prove this. Besides, as I
> > mentioned, this was a temporary fix ... what does it hurt to try it and
> > find it doesn't work. :-)
> 
> There's certainly nothing wrong with trying it, I was just curious
> what gave you the idea, given the symptoms.
> 
> Anno


------------------------------

Date: Wed, 17 Nov 2004 09:46:13 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: perldoc problem on linux
Message-Id: <pan.2004.11.17.14.46.12.514340@fastmail.us>

(Please DON'T top-post - it's considered rude)
On Wed, 17 Nov 2004 06:21:50 -0800, Zhiliang Hu wrote:
<snip>
> James Willmore's suggestion works: "perldoc -t WWW::Search | less"
--
> Returns normal ducumentation.  However, without "less" it still returns
> nothing except login prompt (i.e. "perldoc -t WWW::Search").
> 
> I don't seem to comprehend where the problem is (is "pager" a utility to
> dispaly text like "less"/"more"?), could you suggest further?

If you're on a *nix system, there is an environment setting for which
pager (more, less, some other paging application) to use for viewing
documents.  

To find out if this variable is set, type:
echo $PAGER

If you get just the command line back, this setting is missing and *may*
cause a problem with viewing Perl documentation.  To set the variable to
something "sane", type:
(for BASH)
export PAGER=`which less`
(for CSH - I think ... I always seem to mess up the syntax because I try
to avoid using C-Shell)
setenv PAGER `which less`

This sets the environment variable to use `less` as your pager.

If this environment setting *is* set, then I'm not real sure what's going
on :-(  My thinking is to check your permissions again - just to be sure. 
On my system, they are set to ...

-r-xr-xr-x  1 root root 203 Oct 17 00:15 /usr/bin/perldoc

Past these directions, I'm not sure what else might be going on.

HTH

Jim


------------------------------

Date: 17 Nov 2004 05:37:07 -0800
From: jbesoin@gmail.com (jonathan adams)
Subject: Re: regexp question
Message-Id: <f0877c9f.0411170537.64507982@posting.google.com>

"Sam" <nnpospamm@front.org> wrote in message news:<mDpmd.61$CK.1@twister.nyroc.rr.com>...
> Hello,
> 
> I'm have the following problem: I have pair of numbers like 111.1234 and
> 111.1235. But I want to display that than as 111.1234|5 (to save space on
> the screen).
> Other examples:
> 
> 111.98 and 114.0 -> 111.98|4.0
> 1.2345 and 1.2945 -> 1.2345|945
> 

I came up with a solution that works for the examples you posted plus
a few that I could think of.

$second = join("\t", $first, $second);
$second =~ s/^([\d.]+)[\d.]*?\t\1([\d.]*?)$/$2/;	
print "$first|$second\n";

-jaa


------------------------------

Date: 17 Nov 2004 03:52:17 -0800
From: qazmlp1209@rediffmail.com (qazmlp)
Subject: Save excel including embedded Formulas, Comments etc.
Message-Id: <db9bbf31.0411170352.557b7502@posting.google.com>

Using Perl, is it possible to copy an excel into another excel with
all the Formulas, Comments etc. that are embedded as part of it?


------------------------------

Date: 17 Nov 2004 15:45:42 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Save excel including embedded Formulas, Comments etc.
Message-Id: <Xns95A46D798BB7Basu1cornelledu@132.236.56.8>

qazmlp1209@rediffmail.com (qazmlp) wrote in 
news:db9bbf31.0411170352.557b7502@posting.google.com:

> Using Perl, is it possible to copy an excel into another excel with
> all the Formulas, Comments etc. that are embedded as part of it?

C:\Home> copy source.xls target.xls

Seriously, what is your question?


------------------------------

Date: Wed, 17 Nov 2004 14:15:29 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Search for string and return file name
Message-Id: <oqhmp0lp0ks17ejeei41v9cpvu709veb86@4ax.com>

On Wed, 17 Nov 2004 00:13:57 GMT, "Örjan Johansson"
<misc@actitud.NOSPAM.se> wrote:

>Hi all!
>
>I'm trying to figure out how to go through all files with a certain 
>extension in a directory, search for a string and return the names of the 
>files that contains the string. I have written scripts before that opens a 
>single file for reading and writing, but have no clue how to go through all 
>files in a folder, like a wildcard  *.log kind of thing. Any pointers?

It's not clear if you want to search directories recursively or not.
In the latter case I'd simply let the shell do wildcard expansion, a
la

  perl findfiles.pl mydir/*.log

with findiles.pl along these lines:

  #!/usr/bin/perl -ln
  
  use strict;
  use warnings;
  
  print $ARGV and close ARGV 
    if /whattaiwant/;
  
  __END__


If your shell doesn't do wildcard expansion you may want to do it
yourself inserting this line:

  BEGIN {@ARGV=map glob, @ARGV}

If you want to search recursively then File::Find or one of the
modules that build upon it is your way.


HTH,
Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Wed, 17 Nov 2004 14:49:47 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: Search for string and return file name
Message-Id: <pan.2004.11.17.13.49.46.956697@gmail.com>

On Wed, 17 Nov 2004 02:17:26 -0800, Gerhard M wrote:
> if you're using ...IX try
>   grep -l "text" *.log

What if you're using Linux? :)


-- 
Tore Aursand <toreau@gmail.com>
"Out of missiles. Out of bullets. Down to harsh language." (Unknown)


------------------------------

Date: 17 Nov 2004 04:14:15 -0800
From: brijesh.chavda@patni.com (brijesh)
Subject: Server side redirection
Message-Id: <bb96e66d.0411170414.2e7e8b19@posting.google.com>

Hello all,

I want to perform server side redirection. I want that request should
be forwarded to another cgi file after some processing. Please if
anyone knows , how to do it. drop me a message.

I know "print redirect($url)" method.. But i dont want that , so
please if anyone know any other method , reply it.

Thanks in regards,
Brijesh


------------------------------

Date: 17 Nov 2004 12:21:37 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Server side redirection
Message-Id: <cnffoh$cs8$1@mamenchi.zrz.TU-Berlin.DE>

brijesh <brijesh.chavda@patni.com> wrote in comp.lang.perl.misc:
> Hello all,
> 
> I want to perform server side redirection. I want that request should
> be forwarded to another cgi file after some processing. Please if
> anyone knows , how to do it. drop me a message.

You are asking the wrong people.  This is not a Perl question but
a question about the capabilities of your web server, and possibly
about CGI.  Ask in a group that concerns itself with these.

> I know "print redirect($url)" method.. But i dont want that , so
> please if anyone know any other method , reply it.

You should also give a reason why you reject a working solution.
People won't be inclined to search for an alternative if you don't.

Anno


------------------------------

Date: Wed, 17 Nov 2004 13:58:35 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Server side redirection
Message-Id: <3010beF2rctcfU1@uni-berlin.de>

brijesh wrote:
> I want to perform server side redirection. I want that request should
> be forwarded to another cgi file after some processing. Please if
> anyone knows , how to do it. drop me a message.
> 
> I know "print redirect($url)" method.. But i dont want that , so
> please if anyone know any other method , reply it.

     print "Location: $url\n\n";

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 17 Nov 2004 07:53:54 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Server side redirection
Message-Id: <slrncpmlvi.adi.tadmc@magna.augustmail.com>

brijesh <brijesh.chavda@patni.com> wrote:

> I want to perform server side redirection. 

> I know "print redirect($url)" method.. But i dont want that ,
                                             ^^^^^^^^^^^^^^^^
                                             ^^^^^^^^^^^^^^^^

Why not?

If you don't tell us why the standard way won't work for your
situation, then we cannot suggest a work-around for your situation...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 17 Nov 2004 11:57:04 +0000 (UTC)
From: lukes <razorjack@hihi.gazeta.pl>
Subject: spam assassin - running
Message-Id: <Xns95A4841054A08lukes@193.42.231.152>

hello,
i'm just started to learn Perl language.

I'm trying to run Spam Assasin, my environment:
w2k, ActivePerl v5.6.1, SpamAssassin version 2.63,

i can run SA as standalone module from command line:
perl e:/apps/SpamAssassin/spamassassin -e -t < "email.file" > "email_out.file"

Now, i'm trying to run SA from my own script:

use strict;

use Mail::SpamAssassin;
use Mail::SpamAssassin::NoMailAudit;

my $file = 'spam.txt';		# Name the file
open(INFO, $file);		# Open the file
my @lines = <INFO>;		# Read it into an array
close(INFO);			# Close the file
print @lines;	

my %parameters=( 'message', \@lines );
print "mail new...\n";
my $mail = Mail::SpamAssassin::NoMailAudit->new( %parameters );   # it stops here !
print "spamtest new...\n";
my $spamtest = Mail::SpamAssassin->new();
print "check...\n";
my $status = $spamtest->check( $mail );



and the script stops in line where $mail object is created,
i think that it want to read email from STDIN, because when i hit ^Z char, the program is 
continuing.

This is a description of NEW SpamAssassin:Message
( http://spamassassin.apache.org/full/3.0.x/dist/doc/Mail_SpamAssassin_Message.html )

new()
Creates a Mail::SpamAssassin::Message object. Takes a hash reference as a parameter. The used 
hash key/value pairs are as follows: 
message is either undef (which will use STDIN), a scalar of the entire message, an array reference 
of the message with 1 line per array element, or a file glob which holds the entire contents of the 
message.

I understood that if i pass 'message' key with reference to array ( \@lines ) in hash, it will be used 
as a source for email.

Dow you know what's wrong ?
Thanks for help in advance.

-- 
see ya
lukes


------------------------------

Date: Wed, 17 Nov 2004 14:15:30 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: texdoctk error: "No selection was made"
Message-Id: <kgjmp0tvmp98jb95uhjdfr7ihhp8eff3n9@4ax.com>

[crossposted to clpmisc]

On Tue, 16 Nov 2004 18:12:09 -0600, William Henney
<w.henney@astrosmo.unam.mx> wrote:

>Has anyone else seen this problem? My perl skills are not up to debugging
>it.

I've noticed this under Windows too (under Linux I use texdoc,
period.) I've used and even written (much simpler) pTk applications
and it is not normal in any way. As a side not, a quick glance at the
code revealed that it is especially badly written under many points of
view.

For example right at the beginning we have this:

  if ($IsWin32) {
    use Win32::Registry;
    use Win32::API;
  }

then lots of "&-form" sub calls, etc.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 17 Nov 2004 07:15:55 -0800
From: ioneabu@yahoo.com (wana)
Subject: the antichomp
Message-Id: <bf0b47ca.0411170715.2aa1d853@posting.google.com>

Is there a better way to it than this?

$_ .= "\n" for @ARGV;

wana


------------------------------

Date: 17 Nov 2004 15:43:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: the antichomp
Message-Id: <Xns95A46D110AC70asu1cornelledu@132.236.56.8>

ioneabu@yahoo.com (wana) wrote in news:bf0b47ca.0411170715.2aa1d853
@posting.google.com:

> Is there a better way to it than this?
> 
> $_ .= "\n" for @ARGV;

Of course. Read perldoc -f chomp.

Sinan


------------------------------

Date: Wed, 17 Nov 2004 15:44:11 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: the antichomp
Message-Id: <x7is845vlh.fsf@mail.sysarch.com>

>>>>> "w" == wana  <ioneabu@yahoo.com> writes:

  w> Is there a better way to it than this?
  w> $_ .= "\n" for @ARGV;

s/for/x/ ;

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Wed, 17 Nov 2004 15:58:14 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: the antichomp
Message-Id: <x765445uy1.fsf@mail.sysarch.com>

>>>>> "ASU" == A Sinan Unur <1usa@llenroc.ude.invalid> writes:

  ASU> ioneabu@yahoo.com (wana) wrote in news:bf0b47ca.0411170715.2aa1d853
  ASU> @posting.google.com:

  >> Is there a better way to it than this?
  >> 
  >> $_ .= "\n" for @ARGV;

  ASU> Of course. Read perldoc -f chomp.

and how would chomp append newlines?

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

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 7413
***************************************


home help back first fref pref prev next nref lref last post