[24708] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6865 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 13 18:05:55 2004

Date: Fri, 13 Aug 2004 15:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 13 Aug 2004     Volume: 10 Number: 6865

Today's topics:
    Re: Counting text area <Joe.Smith@inwap.com>
    Re: Counting text area <noreply@gunnar.cc>
    Re: freeing the memory used by a hash <tadmc@augustmail.com>
        Good way to un-chomp an array <initiallast-name@yahoo.xyz>
    Re: Good way to un-chomp an array <noreply@gunnar.cc>
    Re: Good way to un-chomp an array <gifford@umich.edu>
    Re: Good way to un-chomp an array <initiallast-name@yahoo.xyz>
    Re: Good way to un-chomp an array <noreply@gunnar.cc>
    Re: Good way to un-chomp an array <matthew.garrish@sympatico.ca>
    Re: Good way to un-chomp an array <matthew.garrish@sympatico.ca>
        howto convert a *nix DB_File to windows? (dan baker)
    Re: howto convert a *nix DB_File to windows? <noreply@gunnar.cc>
    Re: Lookuping IP address using four nameservers at the  <usenet@morrow.me.uk>
    Re: newbie question-----where is wrong.(only 19 lines c (Anno Siegel)
    Re: newbie question-----where is wrong.(only 19 lines c (Jim Keenan)
        noob question: use File::Copy;      <ltoohey@cisco.com>
    Re: noob question: use File::Copy;      <tadmc@augustmail.com>
    Re: Parsing Visual Studio project files <jgibson@mail.arc.nasa.gov>
    Re: perl documentation in unix info format 510046470588-0001@t-online.de
    Re: perl documentation in unix info format <Joe.Smith@inwap.com>
    Re: perl documentation in unix info format <uri.guttman@fmr.com>
    Re: Perl PDF modules - help please <Andrew@DeFaria.com>
    Re: Reset <> without having it fail once? (Greg Bacon)
    Re: Splitting paragraph into array. <tadmc@augustmail.com>
    Re: testing without shell access <tadmc@augustmail.com>
    Re: What packages are installed? <admin@asarian-host.net>
    Re: What packages are installed? <admin@asarian-host.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 13 Aug 2004 19:23:02 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Counting text area
Message-Id: <py8Tc.249304$%_6.181468@attbi_s01>

Gunnar Hjalmarsson wrote:

> Also, you don't need all those temporary variables. This should do
> what you want:
> 
>     my $count = 0;
>     $count ++ for split /\n/, $in{packageID};

my $count = () = split /\n/,$in{packageID};

	-Joe


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

Date: Fri, 13 Aug 2004 21:29:44 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Counting text area
Message-Id: <2o4jbpF6iahcU1@uni-berlin.de>

Joe Smith wrote:
> Gunnar Hjalmarsson wrote:
>> 
>>     my $count = 0;
>>     $count ++ for split /\n/, $in{packageID};
> 
> my $count = () = split /\n/,$in{packageID};

     my %in = ( packageID => "one\ntwo\nthree" );

     my $count = () = split /\n/, $in{packageID};
     print "$count\n";

     $count = 0;
     $count ++ for split /\n/, $in{packageID};
     print "$count\n";

Outputs:
1
3

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


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

Date: Fri, 13 Aug 2004 13:06:14 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: freeing the memory used by a hash
Message-Id: <slrnchq0om.c7j.tadmc@magna.augustmail.com>

ravi <ec_au_ravi2000@yahoo.com> wrote:

> which is a best way to free the all the memory used by a hash 


Simply by letting the hash go out of scope.


   {  my %hash;
      # do stuff
   }
   # memory is reclaimed by perl here


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


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

Date: Fri, 13 Aug 2004 20:10:58 GMT
From: "Suresh Govindachar" <initiallast-name@yahoo.xyz>
Subject: Good way to un-chomp an array
Message-Id: <mf9Tc.7355$54.112144@typhoon.sonic.net>

Hello,

What is a good way (with respect to speed)
to un-chomp an array?

      for(my $i=0; $i<scalar @lines; $i++)
      {
          $lines[$i] .= "\n";
      }

Thanks,

--Suresh




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

Date: Fri, 13 Aug 2004 22:17:53 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Good way to un-chomp an array
Message-Id: <2o4m65F755tuU1@uni-berlin.de>

Suresh Govindachar wrote:
> What is a good way (with respect to speed)
> to un-chomp an array?
> 
>       for(my $i=0; $i<scalar @lines; $i++)
>       {
>           $lines[$i] .= "\n";
>       }

This is simpler code:

     print map "$_\n", @lines;

As regards speed, I have no idea. If that is a concern of yours, do a 
benchmark ("perldoc Benchmark").

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


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

Date: 13 Aug 2004 16:30:24 -0400
From: Scott W Gifford <gifford@umich.edu>
Subject: Re: Good way to un-chomp an array
Message-Id: <qszhdr6u6fz.fsf@mspacman.gpcc.itd.umich.edu>

"Suresh Govindachar" <initiallast-name@yahoo.xyz> writes:

> Hello,
> 
> What is a good way (with respect to speed)
> to un-chomp an array?

This was the fastest way I could come up with:

  $_ .= "\n"
    foreach @lines;

I benchmarked it, your original, and a map-based solution, and found
it was about 30% faster than your original, and about twice as fast as
map:

  Benchmark: timing 50 iterations of for_index, foreach, map...
   for_index: 18 wallclock secs (17.44 usr +  0.31 sys = 17.75 CPU) @ 2.82/s (n=50)
     foreach: 13 wallclock secs (12.54 usr +  0.17 sys = 12.71 CPU) @ 3.93/s (n=50)
         map: 37 wallclock secs (35.93 usr +  0.55 sys = 36.48 CPU) @ 1.37/s (n=50)

    #!/usr/bin/perl
    
    use Benchmark;
    
    our @arr = (1..100_000);
    
    sub test1
    {
      my @a = @arr;
      $_ .= "\n"
        foreach @a;
    }
    
    sub test2
    {
      my @a = @arr;
      for(my $i=0; $i<scalar @a; $i++)
      {
          $a[$i] .= "\n";
      }
    }
    
    sub test3
    {
      my @a = @arr;
      @a = map { $_."\n" } @a;
    }
    
    timethese(50, {
        foreach => \&test1,
        for_index => \&test2,
        map => \&test3,
    });

-----ScottG.


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

Date: Fri, 13 Aug 2004 20:30:45 GMT
From: "Suresh Govindachar" <initiallast-name@yahoo.xyz>
Subject: Re: Good way to un-chomp an array
Message-Id: <Vx9Tc.7358$54.112316@typhoon.sonic.net>


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2o4m65F755tuU1@uni-berlin.de...
> Suresh Govindachar wrote:
> > What is a good way (with respect to speed)
> > to un-chomp an array?
> >
> >       for(my $i=0; $i<scalar @lines; $i++)
> >       {
> >           $lines[$i] .= "\n";
> >       }
>
> This is simpler code:
>
>      print map "$_\n", @lines;

Doesn't the above code print?  I actually want to
change the array @lines.

> As regards speed, I have no idea. If that is a concern of yours, do a
> benchmark ("perldoc Benchmark").

OK about doing benchmarks;  would like to have candidate
codes to do the benchmark on.

--Suresh




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

Date: Fri, 13 Aug 2004 23:04:10 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Good way to un-chomp an array
Message-Id: <2o4ot1F65mfdU1@uni-berlin.de>

Suresh Govindachar wrote:
> Gunnar Hjalmarsson wrote:
>> Suresh Govindachar wrote:
>>> What is a good way (with respect to speed)
>>> to un-chomp an array?
>>>
>>>      for(my $i=0; $i<scalar @lines; $i++)
>>>      {
>>>          $lines[$i] .= "\n";
>>>      }
>>
>> This is simpler code:
>>
>>     print map "$_\n", @lines;
> 
> Doesn't the above code print?  I actually want to
> change the array @lines.

Then do:

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

Besides, according to Scott's benchmark, that's fastest as well.

However, I can't help to ask: Was it motivated to chomp the lines in 
the first place? Did you for instance do something like this:

     my @lines = <FILE>;
     for (@lines) {
         chomp;
         ...

??
In that case, maybe it would have been possible to keep the trailing 
newline characters all through instead?

And another question: Was it motivated to load all the lines into 
memory, or would it have been sufficient to process them one at a time:

     while (<FILE>) {
         ...

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


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

Date: Fri, 13 Aug 2004 17:12:00 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Good way to un-chomp an array
Message-Id: <y8aTc.32778$Mq1.1886754@news20.bellglobal.com>


"Suresh Govindachar" <initiallast-name@yahoo.xyz> wrote in message
news:mf9Tc.7355$54.112144@typhoon.sonic.net...
> Hello,
>
> What is a good way (with respect to speed)
> to un-chomp an array?
>
>       for(my $i=0; $i<scalar @lines; $i++)

So many ugly C-style for loops lately:

for my $i (0..$#lines)

>       {
>           $lines[$i] .= "\n";
>       }

You could question why you're adding newlines (i.e., can it wait until you
output the array, and do the alternatives at that stage -- map or join, for
example -- make a difference), but otherwise there's no complexity in the
loop you've posted to improve on.

Matt




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

Date: Fri, 13 Aug 2004 17:33:36 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Good way to un-chomp an array
Message-Id: <PsaTc.32797$Mq1.1893850@news20.bellglobal.com>


"Scott W Gifford" <gifford@umich.edu> wrote in message
news:qszhdr6u6fz.fsf@mspacman.gpcc.itd.umich.edu...
> "Suresh Govindachar" <initiallast-name@yahoo.xyz> writes:
>
> > Hello,
> >
> > What is a good way (with respect to speed)
> > to un-chomp an array?
>
> This was the fastest way I could come up with:
>
>   $_ .= "\n"
>     foreach @lines;
>
> I benchmarked it, your original, and a map-based solution, and found
> it was about 30% faster than your original, and about twice as fast as
> map:
>
>   Benchmark: timing 50 iterations of for_index, foreach, map...
>    for_index: 18 wallclock secs (17.44 usr +  0.31 sys = 17.75 CPU) @
2.82/s (n=50)
>      foreach: 13 wallclock secs (12.54 usr +  0.17 sys = 12.71 CPU) @
3.93/s (n=50)
>          map: 37 wallclock secs (35.93 usr +  0.55 sys = 36.48 CPU) @
1.37/s (n=50)
>


 for_index: 11 wallclock secs (11.44 usr +  0.02 sys = 11.45 CPU) @  4.37/s
(n=50)
   foreach: 10 wallclock secs (10.06 usr +  0.02 sys = 10.08 CPU) @  4.96/s
(n=50)

Not sure why you're getting such a large discrepancy.

Matt




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

Date: 13 Aug 2004 12:55:09 -0700
From: botfood@yahoo.com (dan baker)
Subject: howto convert a *nix DB_File to windows?
Message-Id: <13685ef8.0408131155.703f83b3@posting.google.com>

I have a little application that saves data into a tied hash on a *nix
webserver. I would like to be able to pull a copy local to my PC
running windows 98 for testing and backup with as little pain as
possible.

So far the only way I've been able to do this is write export-import
utilities to dump the DB to a text file and reload it at the other
end. Gets to be a pain to maintain if fields change, etc. Is there a
way to more directly convert the binary hash file that gets created to
avoid this manual export-import conversion?

 ...I use a lot of the defaults for tie() when writing to the hash
like:

	use DB_File;
	tie %tempHash , 'DB_File' , "${cfgRelPath_cgi2DB}/${dbfile}" ; 
        ... blah, blah, blah

thanks,

d


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

Date: Fri, 13 Aug 2004 22:01:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: howto convert a *nix DB_File to windows?
Message-Id: <2o4l78F6vpscU1@uni-berlin.de>

dan baker wrote:
> I have a little application that saves data into a tied hash on a
> *nix webserver. I would like to be able to pull a copy local to my
> PC running windows 98 for testing and backup with as little pain as
> possible.

I have done so successfully using SDBM_File, but can't tell whether
the same can be done with files created through DB_File. The issue
might be different Berkeley DB versions.

Btw, you do transfer the files from *nix to Windows in binary mode, right?

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


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

Date: Thu, 12 Aug 2004 17:15:31 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Lookuping IP address using four nameservers at the same time.
Message-Id: <3mhsu1-545.ln1@mauzo.dyndns.org>


Quoth Patrice Auffret <patrice.auffret@intranode.com>:
> On Thu, 05 Aug 2004 14:40:23 +0200
> Tom Regner <regner@dievision.de> wrote:
> [..]
> > for (@children) {waitpid($_, 0);}
> [..]
> 
> 
>   You can put a signal handler in parent process to avoid waitpid() 
>   (since returned status is ignored).
> 
>   $SIG{CHLD} = 'IGNORE';

This isn't strictly portable: perlipc says that 'most Unix platforms'
have this behaviour, but it isn't guaranteed (it depends on your
kernel/C library).

Ben

-- 
   Razors pain you / Rivers are damp
   Acids stain you / And drugs cause cramp.                    [Dorothy Parker]
Guns aren't lawful / Nooses give
  Gas smells awful / You might as well live.                   ben@morrow.me.uk


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

Date: 13 Aug 2004 15:10:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: newbie question-----where is wrong.(only 19 lines code)
Message-Id: <cfilkj$8tg$1@mamenchi.zrz.TU-Berlin.DE>

Facco Eloelo  <artgh@hotmail.com> wrote in comp.lang.perl.misc:
> I want to get the "inputrate" and the "outputrate" from a router's log(using
> show command).and the outputfile looks like:
> 1,1000,0
> 2,3000,2000
> ...
> 
> It should be very easy.But the code doesn't work.can anybody help me?thanks in
> advance.

"Doesn't work", eh?  So what does it do?  Be specific.

> #########code begin##################
> #!/usr/bin/perl

No warnings, no strict.

> $infile='d:\routertest.log';
> $outfile='d:\output';
> open(IN, "< $infile") or die "Couldn't open $infile for reading: $!";
> open(OUT, "> $outfile") or die "Couldn't open $outfile for reading: $!";
                                                             ^^^^^^^
You are trying to overwrite the file, not to read it.  Don't thoughtlessly
copy error messages from one place to another, that's misleading.

> @line=<IN>;
> $num=@line;
> $count=1;
> for($i=0;$i<$num;$i++)
> {
> 
> 	if(chomp($line[$i]) eq "r1-b-sdnn>show int fa1/1/0")

The return value of chomp() is not the chomped string.  See "perldoc
-f chomp".  The condition will never match.

> 	{
> 		@inputrate=split(/''/,$line[$i+14]);

Oh, come on.  The line with the input rate is 15 lines below the "show"
line, not 14.  Are you asking us to do your line-counting for you?

> 		@outrate=split(/''/,$line[$i+1]);

 ...and the line with the output rate is 16 lines down.  Why are you looking
for it in the next line?

Also, you are splitting on a pattern of two consecutive single quotes.
As far as I can see, that pattern doesn't appear at all in your data.
You want to split on white space or blanks.

> 		print OUT "$count,$inputrate[4],$outputrate[4]";

Another counting error.  The numbers appear at offset 5 (not 4), because
the lines start with blanks.

> 		$count++;
> 	}
> }
> ##############code end##########################

[data snipped]

Your code has so many trivial errors, it can hardly count as a serious
attempt to solve the problem.

    my $count = 0;
    my ( $inrate, $outrate);
    while ( <IN> ) {
        chomp;
        $count ++ if $_ eq 'r1-b-sdnn>show int fa1/1/0';
        $inrate = $1 if /input rate (\d+)/;
        if ( /output rate (\d+)/ ) {
            $outrate = $1;
            print OUT "$count, $inrate, $outrate\n";
        }
    }

Anno


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

Date: 13 Aug 2004 13:50:49 -0700
From: jkeen_via_google@yahoo.com (Jim Keenan)
Subject: Re: newbie question-----where is wrong.(only 19 lines code)
Message-Id: <196cb7af.0408131250.513e8aa3@posting.google.com>

Facco Eloelo <artgh@hotmail.com> wrote in message news:<411cbe64.3564633@news.individual.net>...
> I want to get the "inputrate" and the "outputrate" from a router's log(using
> show command).and the outputfile looks like:
> 1,1000,0
> 2,3000,2000
> ...
> 
> It should be very easy.But the code doesn't work.can anybody help me?thanks in
> advance.
> 
> 
> #########code begin##################
> #!/usr/bin/perl
> $infile='d:\routertest.log';
> $outfile='d:\output';
> open(IN, "< $infile") or die "Couldn't open $infile for reading: $!";
> open(OUT, "> $outfile") or die "Couldn't open $outfile for reading: $!";
> @line=<IN>;
> $num=@line;
> $count=1;
> for($i=0;$i<$num;$i++)
> {
> 
> 	if(chomp($line[$i]) eq "r1-b-sdnn>show int fa1/1/0")
> 	{
> 		@inputrate=split(/''/,$line[$i+14]);
> 		@outrate=split(/''/,$line[$i+1]);
> 		print OUT "$count,$inputrate[4],$outputrate[4]";
> 		$count++;
> 	}
> }

There's a lot wrong with it.  First, as another poster implied, you've
got misspellings in your variables that you would have caught had you
started out your program with:

    use strict;
    use warnings;

Second, AFAICT in the line beginning

    if(chomp ...

the condition never returns true; hence the body of the loop is never
executed.

Third, you're splitting on an empty string; my hunch is that you
really wanted to split on a wordspace.

Fourth, for readable output you have to conclude each 'print'
statement with a newline.

Fifth, the line that comes after $i+14 should be $i+15, not $i+1.

You can take it from there.

jimk


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

Date: Fri, 13 Aug 2004 12:28:59 -0500
From: <ltoohey@cisco.com>
Subject: noob question: use File::Copy;     
Message-Id: <1092417912.521691@sj-nntpcache-5>

Hi,

Noob question here:

I am trying to hack a script to move and copy files all files that end in
 .dat
Here is what I have now....

use File::Copy;
copy("*.dat", "temp-dir")
 or die "copy of  files to  temp-dir failed: $!";
move("*.dat", "other-dir")
 or die "move of  files to other-dir directory failed: $!";

I tried a bunch or reg exp syntax but could not figure out how to get all
files that end in .dat

Any help appreciated.....

Thanks,





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

Date: Fri, 13 Aug 2004 13:12:03 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: noob question: use File::Copy;     
Message-Id: <slrnchq13j.c7j.tadmc@magna.augustmail.com>

<ltoohey@cisco.com> <ltoohey@cisco.com> wrote:

> Noob question here:


Putting that in your Subject header *reduces* your chances of
getting help, so consider leaving that out next time.


> I am trying to hack a script to move and copy files all files that end in
> .dat

> use File::Copy;
> copy("*.dat", "temp-dir")


That will only copy that one file (whose 1st character is an asterisk), 
not a bunch of files. copy() does not do globbing, you need to
do that yourself.


> I tried a bunch or reg exp syntax but could not figure out how to get all
> files that end in .dat

   my @dat_files = glob '*.dat';

or
   foreach ( glob '*.dat' ) {
      copy( $_, 'temp-dir' ) or die...
   }


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


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

Date: Fri, 13 Aug 2004 09:59:59 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Parsing Visual Studio project files
Message-Id: <130820040959590677%jgibson@mail.arc.nasa.gov>

In article <411CA161.4C34AB04@yahoo.com>, Ann Ominous
<a_ominous.rover@yahoo.com> wrote:

> Hi
> I've got a Visual Studio workspace with 100 project files.  I have to
> document the compiler flags used in each project and would like to do
> this in Perl.
> There are several possible build configurations in the project files.
> I'm only interested in the Win32 Release config.  I want to read all the
> CPP lines in the relevant config.  I've not been able to extract the
> relevant lines.  I can get the starting line of each block, but am not
> pushing the CPP flags into the array.  I think my problem lies in using
> next /last.
> Here's my code and some data from one project.
> TIA for any help.
> -ao-
> 
> 
> __CODE__
> #!/usr/local/bin/perl -w
> 
> #use strict;

Why comment out use strict? Have you seen the guidelines for this
newsgroup?

> 
> # open the Build All worksapce, read all the projects and print out the
> # compiler flags used
> 
> $workspace = $ARGV[1];
> $workspace = "BuildAll.dsw";

Please clean up your program before posting. Your post contains several
instances of commented-out and dead code like this. You are more likely
to get good help if you take the time to reduce your posted code to a
minimal, complete example.

[ code snipped]

>   # quit when we get to next IF stagement
>   if ( /IF?/ )

This regular expression will match on the character I, followed by zero
or one of the character F. Therefore, your search for the pattern /CPP/
will end at the first line that contains a capital I. From your sample
data, I would say that you want the regular expression /^!IF/ instead.

>   {
>       $done = 1;
>       last;
>   }
>   #next;
>      }
>  }
>  $done && print "@cpp_flags";
>     }
> 
>     close( PROJECT )
>  || die "Cannot close project $p\n";
> }
> 


[data snipped]


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

Date: 13 Aug 2004 19:48:32 +0200
From: 510046470588-0001@t-online.de
Subject: Re: perl documentation in unix info format
Message-Id: <87zn4zudxr.fsf@debian.i-did-not-set--mail-host-address--so-shoot-me>

matthew <pikpus@wp.pl> writes:

> Do You where can I find such documentation in info format ?

http://search.cpan.org/~mjaeg/perl-info.5.004_1/
it's already 7 years old, though

most supreme Perl Gurus like Christiansen are Emacs haters
and thus don't approve of info file documentation.

Klaus Schilling


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

Date: Fri, 13 Aug 2004 19:30:54 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: perl documentation in unix info format
Message-Id: <OF8Tc.245705$a24.47038@attbi_s03>

matthew wrote:

> Hallo
> Do You where can I find such documentation in info format ?

I prefer using 'lynx' over 'info' for viewing hyperlinked documents.

unix% lynx http://www.perldoc.com/perl5.8.4/pod/perlrun.html
unix% lynx http://www.perldoc.com/perl5.8.4/pod/perl.html

	-Joe


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

Date: Fri, 13 Aug 2004 15:37:19 -0400
From: Uri Guttman <uri.guttman@fmr.com>
Subject: Re: perl documentation in unix info format
Message-Id: <lihdr67rtc.fsf@fmr.com>

>>>>> "m" == matthew  <pikpus@wp.pl> writes:

  m> Do You where can I find such documentation in info format ?

have you searched cpan? there are a wide range of pod converter modules
and i bet texinfo is among them. then you just convert it yourself and
you have it the way you like it.

uri


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

Date: Fri, 13 Aug 2004 10:21:33 -0700
From: Andrew DeFaria <Andrew@DeFaria.com>
Subject: Re: Perl PDF modules - help please
Message-Id: <72530$411cf826$43661972$17853@msgid.meganewsservers.com>

Anno Siegel wrote:

> Andrew DeFaria <Andrew@DeFaria.com> wrote in comp.lang.perl.misc:
>
>> Matt Garrish wrote:
>>
>>> Please bear in mind that the people you're insulting will never need 
>>> *your* help with Perl.
>>
>> How do you know that?
>
> We've seen you perform.

No you haven't.
-- 
Madness takes its toll. Please have exact change.


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

Date: Fri, 13 Aug 2004 15:13:48 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Reset <> without having it fail once?
Message-Id: <10hpmlcm8fkt117@corp.supernews.com>

In article <973Tc.93661$M95.70116@pd7tw1no>,
    Peter Scott <Peter@PSDT.com> wrote:

: In article <10hn01c4o4um629@corp.supernews.com>,
:  gbacon@hiwaay.net (Greg Bacon) writes:
:
: >Use exec!
:
: Nice solution.

Thanks!

: >[...]
: >        while (<>) {
: >            next unless /$pat/;
: >
: >            no warnings 'exec';
: 
: The line above should not be necessary; the only statement following
: exec in the control flow is a die.

The behavior surprised me too, but see below:

$ diff -u try.orig try.nonesuch
--- try.orig    2004-08-13 09:58:52.163202400 -0500
+++ try.nonesuch        2004-08-13 10:03:47.860649900 -0500
@@ -15,7 +15,7 @@
         next unless /$pat/;

         no warnings 'exec';
-        exec $0, "--id=$1", @saved;
+        exec "nonesuch", "--id=$1", @saved;
         die "$0: exec: $!";
     }


$ ./try.nonesuch JOHN log?
 ./try.nonesuch: exec: No such file or directory at ./try.nonesuch
line 19, <> line 9.

$ diff -u try.orig try.nonesuch-warningson
--- try.orig    2004-08-13 09:58:52.163202400 -0500
+++ try.nonesuch-warningson     2004-08-13 10:01:37.613150700 -0500
@@ -14,8 +14,8 @@
     while (<>) {
         next unless /$pat/;

-        no warnings 'exec';
-        exec $0, "--id=$1", @saved;
+        #no warnings 'exec';
+        exec "nonesuch", "--id=$1", @saved;
         die "$0: exec: $!";
     }

$ ./try.nonesuch-warningson JOHN log?
Can't exec "nonesuch": No such file or directory at
 ./try.nonesuch-warningson line 18, <> line 9.
 ./try.nonesuch-warningson: exec: No such file or directory at
 ./try.nonesuch-warningson line 19, <> line 9.

The warnings pragma enables an autowarning on a failed exec, but I'm not
sure where this is documented.

Hope this helps,
Greg
-- 
If a potential disaster can't be used to justify the expansion of the
government, the media ignore it or else bury it on page 17.
    -- Gary North


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

Date: Fri, 13 Aug 2004 13:22:05 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Splitting paragraph into array.
Message-Id: <slrnchq1md.c7j.tadmc@magna.augustmail.com>

Sandman <mr@sandman.net> wrote:


> Well, right now I'm splittin on two or more newlines, 

> My problem now is that if I have a text block like below:
> 
>     Hello, my nickname is Sandman and I am coding
>     some Perl. Here is an example:
> 
>     <code>
>         print "Hello World!";
> 
>         print "Foo";
>     </code>
> 
>     Call me
> 
> The above would, given the rules I use now, yield four parts, as such:
> 
>     ---------------------------------------------
>     Hello, my nickname is Sandman and I am coding
>     some Perl. Here is an example:
>     ---------------------------------------------
>     <code>
>         print "Hello World!";
>     ---------------------------------------------
>         print "Foo";
>     </code>
>     ---------------------------------------------
>     Call me
>     ---------------------------------------------
> 
> But I would want it to end up in three parts, as such:
> 
>     ---------------------------------------------
>     Hello, my nickname is Sandman and I am coding
>     some Perl. Here is an example:
>     ---------------------------------------------
>     <code>
>         print "Hello World!";
> 
>         print "Foo";
>     </code>
>     ---------------------------------------------
>     Call me
>     ---------------------------------------------

> Any ideas on how to solve it?


foreach ( grep {defined and length} split m#\n{2,}|(<code>.*?</code>)#s, $txt )


Buggy and fragile, but that is to be expected when processing HTML
without a real parser. (hint: you should use an HTML::* module
for processing HTML data).


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


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

Date: Fri, 13 Aug 2004 13:04:39 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: testing without shell access
Message-Id: <slrnchq0ln.c7j.tadmc@magna.augustmail.com>

Joe Smith <Joe.Smith@inwap.com> wrote:
> Tad McClellan wrote:
> 
>> You should always, yes *always*, check the return value from open():
>>    open (STDERR, '>scriptErr.txt') or die "could not open 'scriptErr.txt' $!";
> 
> open(STDERR,'>','scriptErr.txt') or die "Since STDERR is not open,


It might be open.

Failing to re-open does not mean that it is not opened at all, just
that it isn't going to go where you wanted it to go.


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


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

Date: Fri, 13 Aug 2004 17:50:37 +0200
From: "Mark" <admin@asarian-host.net>
Subject: Re: What packages are installed?
Message-Id: <3r-dnSych_7LfoHcRVn-jA@giganews.com>

Douglas Hunter wrote:

> On 2004-08-12, Mark <admin@asarian-host.net> wrote:
>> Hello,
>>
>> I like to upgrade to Perl 5.8.5 (FreeBSD 4.10-p2); I was wondering,
>> though, is there a quick way to determine what packages have been
>> installed under the old Perl hierarchy? (5.8.2).
>
> One of the entries here might help:
> http://www.cpan.org/misc/cpan-faq.html#How_installed_modules

Excellent! Thanks; just what the docter ordered (actually, he told me to
RTFM next time; but hey).

- Mark




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

Date: Fri, 13 Aug 2004 17:51:40 +0200
From: "Mark" <admin@asarian-host.net>
Subject: Re: What packages are installed?
Message-Id: <NNWdnSGtV-0OfoHcRVn-gg@giganews.com>

Gregory Toomey wrote:

> Mark wrote:
>
>> Hello,
>>
>> I like to upgrade to Perl 5.8.5 (FreeBSD 4.10-p2); I was wondering,
>> though, is there a quick way to determine what packages have been
>> installed under the old Perl hierarchy? (5.8.2).
>>
>> Thanks,
>>
>> - Mark
>
> I've seen people use Perldiver:
> http://www.scriptsolutions.com/programs/free/perldiver/

I will check this out too; thanks!

- Mark




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

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


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