[28135] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9499 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 19 14:05:43 2006

Date: Wed, 19 Jul 2006 11:05:06 -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           Wed, 19 Jul 2006     Volume: 10 Number: 9499

Today's topics:
        2 Perl Software Engineers needed for great contract in  jessica.dwyer@scfoster.com
    Re: 2 Perl Software Engineers needed for great contract usenet@DavidFilmer.com
    Re: A subroutine for gcd <bik.mido@tiscalinet.it>
    Re: A subroutine for gcd <glennj@ncf.ca>
        Help with script to get backup log status on windows sy <ih8spam@spamsux.org>
    Re: Help with script to get backup log status on window <1usa@llenroc.ude.invalid>
    Re: Help with script to get backup log status on window <ih8spam@spamsux.org>
    Re: Help with script to get backup log status on window <1usa@llenroc.ude.invalid>
    Re: Help with tied/nested data structures xhoster@gmail.com
    Re: Help with tied/nested data structures <clint@0lsen.net>
    Re: hostname <-> ip address <benmorrow@tiscali.co.uk>
    Re: How to add variables to strings? <tzz@lifelogs.com>
        How to print at certain point in perl <Amaninder.Saini@gmail.com>
    Re: How to print at certain point in perl <rvtol+news@isolution.nl>
    Re: How to print at certain point in perl <Amaninder.Saini@gmail.com>
    Re: How to print at certain point in perl <glennj@ncf.ca>
    Re: How to print at certain point in perl <David.Squire@no.spam.from.here.au>
        How to use a module's @EXPORT array to document its exp <news@lawshouse.org>
    Re: Net::Telnet - Library Application <laff7430@bellsouth.net>
    Re: Premature end of script headers: mail.cgi <benmorrow@tiscali.co.uk>
    Re: tuff problem of the day for linux <bik.mido@tiscalinet.it>
    Re: tuff problem of the day for linux <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Jul 2006 09:41:55 -0700
From: jessica.dwyer@scfoster.com
Subject: 2 Perl Software Engineers needed for great contract in NYC
Message-Id: <1153327315.703029.64910@s13g2000cwa.googlegroups.com>

All,
I have 2 Perl Software Engineer contract positions for a direct client
in New York City.  If you or someone you know may be interested, please
forward a confidential resume to jessica.dwyer@scfoster.com.  I will
respond immediately with feedback!
Thanks in advance!
Jessica Dwyer
SCFoster
jessica.dwyer@scfoster.com



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

Date: 19 Jul 2006 09:47:04 -0700
From: usenet@DavidFilmer.com
Subject: Re: 2 Perl Software Engineers needed for great contract in NYC
Message-Id: <1153327624.024486.217860@p79g2000cwp.googlegroups.com>

jessica.dw...@scfoster.com wrote:
> I have 2 Perl Software Engineer contract positions for a direct client

You must be getting this newsgroup confused with http://jobs.perl.org

-- 
David Filmer (http://DavidFilmer.com)



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

Date: Wed, 19 Jul 2006 17:16:34 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A subroutine for gcd
Message-Id: <pkhsb29m8kili51bjbvumt7e3429g6ll9u@4ax.com>

On Tue, 18 Jul 2006 16:09:07 +0200, gamo <gamo@telecable.es> wrote:

>> >Does anyone knows how to write a sub for gcd?
                                   ^^^^^^^^^^^^^
                                   ^^^^^^^^^^^^^

>> Yes I know!
>> 
>> Ok, now I know you don't believe me...
>> 
>>   sub gcd { $_[1]?gcd($_[1],$_[0]%$_[1]):$_[0] }
>> 
>I belive you, but it is just a gcd of a PAIR of numbers.

First of all with the information you supplied (see above!) it may
have been whatever. I *guessed* you were referring to the Greatest
Common Divisor, and supplied *a* sub for the most obvious case that
occurred to me. BTW, you do know that amongst other things

  gcd(n,a,b,...) = gcd(gcd(n,a),b,...) = gcd(gcd(n,a),gcd(n,b),...),

don't you? Well, the following will work for any *positive* number of
arguments.

  sub gcd { my $n=pop;@_?gcd($n?map gcd($n,$_%$n),@_:@_):$n }

Please notice the simmetry between the @_?...:$n construct and the
$n?...:@_ one. Isn't it amazing? ;-)

>I find this in the ToolBox module
>
>sub gcd {

Well, if you had it, why are you asking in the first place?!? Note:
this will work for *any* number of arguments.


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: 19 Jul 2006 15:32:59 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: A subroutine for gcd
Message-Id: <slrnebsk5b.m92.glennj@smeagol.ncf.ca>

At 2006-07-19 11:16AM, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>    sub gcd { my $n=pop;@_?gcd($n?map gcd($n,$_%$n),@_:@_):$n }
                  ^^^^^^...............^^^^^^^^^^^^^
Do you mean $n=shift ?  

-- 
Glenn Jackman
Ulterior Designer


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

Date: Wed, 19 Jul 2006 11:58:00 -0400
From: "Matt Williamson" <ih8spam@spamsux.org>
Subject: Help with script to get backup log status on windows systems
Message-Id: <e9lkp8$9gt$1@nntp.aioe.org>

The purpose of this script is to quickly get a status on all of my nightly 
backups. It's working for everything but the .xml backup files. There are 
multiple .xml files created each night for the various processes that occur, 
the actual backup log is only one of them. I've determined that the .xml 
backup log files that I want are all encoded utf16le and the others are 
utf8. I only want to read the utf16le .xml files and print the server name 
and filename for just the latest of those but I can't figure out the best 
way to do it. Also, if you have any suggestions on the script in general, 
please feel free to comment. I'm new at this, so any advice from experienced 
coders is welcome and appreciated.

use strict;
use warnings;

my @content;
my @header;

my %belogdirs = (
 "\\\\Server1"   => "\\d\$\\Backup Exec\\data\\bex*.txt",
 \\\\Server2    => "\\c\$\\Program Files\\Seagate Software\\Backup 
Exec\\Nt\\Data\\bex*.txt",
 \\\\Server3    => "\\c\$\\Program Files\\Veritas\\Backup 
Exec\\Nt\\Data\\bex*.txt",
 \\\\Server4     => "\\c\$\\Program Files\\Veritas\\Backup 
Exec\\Nt\\Data\\bex*.txt",
 \\\\Server5     => "\\c\$\\Program Files\\Veritas\\Backup 
Exec\\Nt\\Data\\bex*.txt",
 \\\\Server6   => "\\c\$\\Program Files\\Veritas\\Backup 
Exec\\Nt\\Data\\bex*.xml"
 );

open FILE, ">C:\\Backup Tape Log.txt";
foreach my $server (keys %belogdirs) {
  my $fullpath = $server.$belogdirs{$server};
  my @files = `dir "$fullpath" /OD /B`;
  foreach my $file (reverse @files) {
    $fullpath =~ s/bex\*\.xml|bex\*\.txt/$file/i;
    chomp $fullpath;
    open F, $fullpath or die "can't open $file: $!\n";
    read F, my $buffer, 2;
    @header = unpack "h*", $buffer;
    close F;

 if ($header[0] =~ /ffef/i) { #handle the utf16 .xml files
      open F, "<:encoding(utf16le)", $fullpath or
      die "can't open $file: $!\n";
      @content = <F>;
      close F;
    }
    elsif ($header[0] =~ /efff/i) { # just in case?
      open F, "<:encoding(utf16be)", $fullpath or
      die "can't open $file: $!\n";
      @content = <F>;
      close F;
    }
    else { # handle the .txt files
  open F, $fullpath  or
  die "can't open $file: $!\n";
  @content = <F>;
     close F;
 }

#   $server =~ s/\\\\/Server: /;
#   print FILE $server, "\n";
#  print FILE "Log File: ",$fullpath,"\n";

   foreach my $line (@content){
  if ($line =~ /(job (?:started|ended|completion status)):\s*(.*?)\s*$/i) {
    my ($job_type, $status) = ($1, $2);
    print FILE "$job_type: $status\n";
  }
   }
  print FILE "\n";
  last;
  }
}

close FILE;
exec("notepad C:\\Backup Tape Log.txt");


TIA

Matt 




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

Date: Wed, 19 Jul 2006 16:02:21 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Help with script to get backup log status on windows systems
Message-Id: <Xns98057A8FCC814asu1cornelledu@127.0.0.1>

"Matt Williamson" <ih8spam@spamsux.org> wrote in
news:e9lkp8$9gt$1@nntp.aioe.org: 

>  if ($header[0] =~ /ffef/i) { #handle the utf16 .xml files

I can't comment on the rest of your post, but here you are looking for a 
sequence of characters 'f', 'f', 'e', 'f' anywhere in the string. Those 
characters have nothing to do with the BOM.

http://www.unicode.org/faq/utf_bom.html#BOM

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



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

Date: Wed, 19 Jul 2006 13:02:15 -0400
From: "Matt Williamson" <ih8spam@spamsux.org>
Subject: Re: Help with script to get backup log status on windows systems
Message-Id: <e9lohn$jip$1@nntp.aioe.org>

So, getting the first 2 bytes of the file, converting them to hex and
checking the string representation of the hex characters isn't the right way
to do it? That part seems to work fine. What is a better way?
It took me 4 hours to come up with that <g>

Matt

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
news:Xns98057A8FCC814asu1cornelledu@127.0.0.1...
> "Matt Williamson" <ih8spam@spamsux.org> wrote in
> news:e9lkp8$9gt$1@nntp.aioe.org:
>
>>  if ($header[0] =~ /ffef/i) { #handle the utf16 .xml files
>
> I can't comment on the rest of your post, but here you are looking for a
> sequence of characters 'f', 'f', 'e', 'f' anywhere in the string. Those
> characters have nothing to do with the BOM.
>
> http://www.unicode.org/faq/utf_bom.html#BOM
>
> Sinan
>
> -- 
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
> 




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

Date: Wed, 19 Jul 2006 17:06:52 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Help with script to get backup log status on windows systems
Message-Id: <Xns9805857FBF43Fasu1cornelledu@127.0.0.1>

"Matt Williamson" <ih8spam@spamsux.org> wrote in
news:e9lohn$jip$1@nntp.aioe.org: 

> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
> news:Xns98057A8FCC814asu1cornelledu@127.0.0.1...
>> "Matt Williamson" <ih8spam@spamsux.org> wrote in
>> news:e9lkp8$9gt$1@nntp.aioe.org:
>>
>>>  if ($header[0] =~ /ffef/i) { #handle the utf16 .xml files
>>
>> I can't comment on the rest of your post, but here you are looking
>> for a sequence of characters 'f', 'f', 'e', 'f' anywhere in the
>> string. Those characters have nothing to do with the BOM.
>>
>> http://www.unicode.org/faq/utf_bom.html#BOM

> So, getting the first 2 bytes of the file, converting them to hex and
> checking the string representation of the hex characters isn't the
> right way to do it? That part seems to work fine. What is a better
> way? It took me 4 hours to come up with that <g>

I did not realize that was what you were doing.

Sinan

PS: Please do not top post and don't quote sigs.

-- 
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



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

Date: 19 Jul 2006 16:24:27 GMT
From: xhoster@gmail.com
Subject: Re: Help with tied/nested data structures
Message-Id: <20060719122944.259$i5@newsreader.com>

"Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net> wrote:
> On 07/18/2006 07:50 PM, Clint Olsen wrote:
> > Hi:
> >
> > I have a script included in the post that behaves strangely.
> > Originally I had a plain hash that had a few scalars inside of it that
> > were tied. However, for reasons I won't bore you with here, I needed to
> > also tie the containing hash.  However, once I did this, I broke the
> > tied scalars. After I tie the scalar, it nearly gets immediately culled
> > by the Perl garbage collector (DESTROY is called),
> > [...]
> > package main;
> >
> > my %hash;
> >
> > tie %hash, 'Foo';
> >
> > tie $hash{bar}, 'Bar', 'blah';
> >
> > $hash{booga} = 'baz';
> >
> > print "Tied scalar value is $hash{bar}\n";
>
> One part of the problem is that you're not saving the values
> returned by tie.

That is not the problem.

> Those values are the object references that
> underly the tied hashes and scalars. Since the ref counts for
> those objects is zero right after you've created them,

Another reference is also stored with the thing tied.  Well, except
for some bug is preventing that in this case.

> the GC
> cleans them up almost immediately, so save the values:
>
> my $object1 = tie %hash, 'Foo';
>
> my $object2 = tie $hash{bar}, 'Bar', 'blah';

That delays the DESTROY call, but it doesn't solve the problem.  The thing
that is tied now exists, but it is still not associated with the hash
element, it is just free standing.

I thought the problem was that you were tying a copy returned by the tied
FETCH (rather than the the actual thing stored in the underlying structure)
but it turns out there is no FETCH in the first place.  Seems like some
kind of bug.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Wed, 19 Jul 2006 12:11:16 -0500
From: Clint Olsen <clint@0lsen.net>
Subject: Re: Help with tied/nested data structures
Message-Id: <slrnebsptk.1cpj.clint@belle.0lsen.net>

On 2006-07-19, anno4000@radom.zrz.tu-berlin.de <anno4000@radom.zrz.tu-berlin.de> wrote:
> No.  Normally the object is stored in the magic structure that is
> attached to the tied variable, refcounted and all.  As long as that magic
> survives, the object survives.  The question is why it doesn't in this
> case.
>
> Actually another question needs to be asked first.  What are the expected
> semantics of
>
>     tie $hash{ key}, 'TieScalar';
>
> when %hash itself it tied.  Scalar tie() only works on actual scalar
> variables (SVs), but there is no such thing associated with $hash{ key}
> with a tied hash.  So there really is no place to attach the scalar tie
> magic to.  Perl should probably warn about that.  At the moment it
> appears to silently drop it, as witnessed by the early call to DESTROY.
>
> If you want to tie the values of a tied hash, you'd have to look into the
> hash-tying mechanism itself.  If there is a definite scalar for every key
> where the value is stored, you'd have to tie that.  If there is no such
> scalar, you're out of luck.
>
> Then again, it seems to me that anything you could to in an additional
> scalar tie of the value you could also to in the hash-tie in the first
> place.

In my case, I only want to tie a few scalars (keys), not all of them.  So,
adding this code to the FETCH method of the hash is kludgy at best.  We
elected to tie the scalars to avoid a performance problem.  Before we were
executing an external program for these and when we included the package
the external (slow) program was executed a bunch of times, so by tying the
scalars we only run it when the value is actually read.

I should point out that I have in the past been able to do nested tied
structures and I didn't have problems with the Perl GC culling the objects.
I think this was around 5.6.X though...

-Clint


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

Date: Wed, 19 Jul 2006 14:44:29 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: hostname <-> ip address
Message-Id: <tip1p3-61i.ln1@osiris.mauzo.dyndns.org>

[please don't top-post. quoting fixed]

Quoth "Ani" <call.anirban@gmail.com>:
> anno4...@radom.zrz.tu-berlin.de wrote:
> > Ani <call.anirban@gmail.com> wrote in comp.lang.perl.misc:
> > > Hi All,
> > > If I use the following script to get ip address if i supply a hostname
> > > & vice-versa:
> >
> > [...]
> >
> > > When I execute with the following cmdline:
> > >
> > > $ perl getdnsinfo.pl netscape.com
> > >
> > > then I get the following output:
> > >
> > > Hostname is netscape.com
> > > Maps to these IPs:
> > > IP: 152.163.211.51
> > >
> > > but when I execute with the ip address I got from this output:
> > >
> > > $ perl getdnsinfo.pl 152.163.211.51
> > >
> > > then I am getting the following output:
> > >
> > > Hostname is nscp-rtc-vipb.websys.aol.com
> > > Maps to these IPs:
> > > IP: 152.163.211.51
> > >
> > > I am unable to get the original hostname 'netscape.com' instead of
> > > 'nscp-rtc-vipb.websys.aol.com'.
> > > How can I get the original hostname?
> >
> > That has nothing to do with Perl, it's a question about DNS.  An IP
> > address can be associated with one primary domain name and any number
> > of aliases.  All aliases resolve to the same IP address.  The IP
> > address resolves to the primary domain name.  Possible aliases are
> > not delivered.  At least that's how every DNS worked that I looked at.
> >
> > IOW, your "original hostname" is not the primary host name but an
> > alias.  You won't get it back from gethostbyaddr() (and neither
> > from gethostbyname()).
> 
> Is it possible to get the list of aliases associated with an IP
> address?

No, it's not.

Ben

-- 
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces mollit animos, tristesque mentes erigit.|benmorrow@tiscali.co.uk
Musica vel ipsas arbores et horridas movet feras.     |


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

Date: Wed, 19 Jul 2006 13:45:23 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: How to add variables to strings?
Message-Id: <g69u05dqyj0.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 18 Jul 2006, mritty@gmail.com wrote:

Ted Zlatanov wrote:
>> In any case, the code is incomplete and my original questions are
>> valid, minus "won't compile."  Who knows what $T holds, and what the
>> OP expects.
>
> I disagree.  I think the OP was plenty clear in his original post:
>>> I want to construct a SQL statement which consists of a string added to
>>> some information stored in variables. But its not adding the text of
>>> the variable to the first part of the string, just storing the value of
>>> the variable:
>>>
>>> $statement = "select * FROM logarama WHERE timestamp > ". $T[4]+1
>
> The value of $T is irrelevant, since the code does not use $T.  The
> value of @T is also irrelevant, as the question is about why the value
> of $T[4] plus 1 does not get added to the string.  

Yes.  Thanks for catching my mistake.  I was thinking of @T, of
course, and I missed the obvious bug as you point out.

> The OP said exactly what he expected: "adding the text of the
> variable to the first part of the string".  (The form of the request
> leads me to believe the OP is not a native English-speaker, which
> more than excuses (to me) grammatical errors).  Anyone who runs the
> code sees what happens instead - $statement gets the value of 1.

I see.  The question was difficult for me to understand and I missed
the real problem, but I'm glad you got it.

Ted


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

Date: 19 Jul 2006 09:08:11 -0700
From: "Amaninder" <Amaninder.Saini@gmail.com>
Subject: How to print at certain point in perl
Message-Id: <1153325291.435755.207920@75g2000cwc.googlegroups.com>

Hi everyone

I am new to perl so please help

I want to print something, lets say "abc",  at certain point on the
screen no matter whats come before it. For example,  if there are
following lines

wwwwwwwwwwwwwwwwwwwwwwwwwwww
qqqqqqqqqqqqqqqqqqqqqq
zzzzzzzzzzzzzzzzzzzzzzzzzzzz
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

i want to print "abc" always at fixed length from  the left.  Like


wwwwwwwwwwwwwwwwwwwwwwwwwwww       abc
qqqqqqqqqqqqqqqqqqqqq                                 abc
zzzzzzzzzzzzzzzzzzzzzzzzzzzz                     abc
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee  abc

I dont know how to do it in perl. If someone did this before then
please let me know. :)

Regards
Amaninder



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

Date: Wed, 19 Jul 2006 18:32:51 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How to print at certain point in perl
Message-Id: <e9lue1.1g4.1@news.isolution.nl>

Amaninder schreef:

> wwwwwwwwwwwwwwwwwwwwwwwwwwww       abc
> qqqqqqqqqqqqqqqqqqqqq                                 abc
> zzzzzzzzzzzzzzzzzzzzzzzzzzzz                     abc
> eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee  abc

I think you are posting in a non-proportional font, since the length of
thye strings before 'abc' are  all of different lengths.

perl -wple '
  $n = 40 ;
  $_ = substr( $_ . q{ } x $n, 0, $n ) . q{abc} ;
' infile

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

Date: 19 Jul 2006 09:58:06 -0700
From: "Amaninder" <Amaninder.Saini@gmail.com>
Subject: Re: How to print at certain point in perl
Message-Id: <1153328286.491342.150990@s13g2000cwa.googlegroups.com>

Yes, indeed its a non-proportinal font. I dont know how to post in
proportional font but if you click the "Proportional Font"  at the top
right corner, you can see what i mean. :)

Regards
Amaninder



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

Date: 19 Jul 2006 17:07:19 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: How to print at certain point in perl
Message-Id: <slrnebspm7.m92.glennj@smeagol.ncf.ca>

At 2006-07-19 12:08PM, Amaninder <Amaninder.Saini@gmail.com> wrote:
>  i want to print "abc" always at fixed length from  the left.  Like

try "printf"

-- 
Glenn Jackman
Ulterior Designer


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

Date: Wed, 19 Jul 2006 18:10:41 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: How to print at certain point in perl
Message-Id: <e9lp2h$1h2$1@gemini.csx.cam.ac.uk>

Amaninder wrote:
> Yes, indeed its a non-proportinal font.

What? To whom are you replying? Please quote some context and retain 
author attribution when replying, as has been the custom on usenet for 
decades.

> I dont know how to post in
> proportional font but if you click the "Proportional Font"  at the top
> right corner, you can see what i mean. :)
> 

Again, what are you talking about? Let me guess... the Google Groups 
interface? You seem to be under the mistaken impression that you are 
posting to some forum run by Google. You are not. You are posting to a 
usenet newsgroup and many, probably most, of the readers are using 
dedicated newsreader software, or newsgroup-aware mailers such as 
Thunderbird.

There is no font associated with a newsgroup post. It's just characters. 
The issue is that *you* should compose your post using a 
non-proportional font if you want spacing to be significant on usenet.


DS


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

Date: Wed, 19 Jul 2006 17:52:15 +0100
From: Henry Law <news@lawshouse.org>
Subject: How to use a module's @EXPORT array to document its exported objects?
Message-Id: <1153327933.17726.0@proxy00.news.clara.net>

I have a library of modules for a Perl application which has code 
running on a Windows client and on a Linux server.  Code writing and 
documenting is done on the client.  The number of subroutines has 
expanded considerably, and I'm still developing, so I'm trying to 
develop a simple utility which will document which objects are exported 
from each module, and its version.

I've looked on CPAN without finding anything simple that does what I 
want (but I'm not convinced I searched with the right strings, so 
pointers would be welcomed), so I knocked up a simple application.  It 
_almost_ works and I would like it if someone can help me make the last 
jump.

Here's the core of my code, using a standard module so you can run it if 
you need to:

#! /usr/bin/perl
use strict; use warnings;
require File::Copy;
foreach my $exported_sub (@File::Copy::EXPORT_OK) {
	print "$exported_sub\n";
}

For this particular module it works fine:

> F:\>tryit.pl
> cp
> mv

But if I run it on my Windows _development_ _client_ against one of the 
_server_ modules the "require" statement croaks because the server has a 
different set of Perl modules installed.  I get "Can't locate xxx in 
@INC (@INC contains ..." messages.

So can I get access to the @EXPORT variables from a module without 
causing the "require" statement to fail because it can't load dependent 
modules?   Or can I suppress the "Can't locate" messages safely just for 
the tool?  Or is there some other way of extracting the names of the 
exported objects easily?

I realise that I could work around the problem either by running the 
documentation tool on the server for the server modules, or by 
installing the server modules on the client where I'm running the 
documentation tool.  The former is inconvenient; the latter ugly and 
maybe not even possible.


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

Date: Wed, 19 Jul 2006 11:03:39 -0400
From: Carl Lafferty <laff7430@bellsouth.net>
Subject: Re: Net::Telnet - Library Application
Message-Id: <zQrvg.12297$iP1.9987@bignews2.bellsouth.net>

Carl Lafferty wrote:
> I *think* I can fix it with a kludge of my own but ... well it's late 
> and that is my progress report.
> 

OK, I did fix it.  I took the length of the string I expect, multiplied 
by how many and subtracted the number of \x8f's I was going to get 
(which is the same as the number I expect minus 1, grab that, split on 
the \x8f's and done.

Now to take this and turn it into a reasonable facsimile of an online 
card catalog that accesses our database directly.

I love linux/perl when it can save so much $$$$.

Thanks for all the help I got here.  I learned a LOT about regex and 
more about perl in general.

--
Carl Lafferty


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

Date: Wed, 19 Jul 2006 14:41:00 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Premature end of script headers: mail.cgi
Message-Id: <ccp1p3-61i.ln1@osiris.mauzo.dyndns.org>


Quoth usenet@DavidFilmer.com:
> yusuf wrote:
> > Sorry, the script below has other errors (in the for loop), please
> > ignore the posting.
> 
> Indeed it does (as Tad has also pointed out).
> 
> FWIW, the mesage you are seeing ("premature end...") is
> characteristicly displayed in a browser when a  CGI program is invoked
> but the program fails because of a syntax or runtime error. The script
> generates error messages (or maybe nothing at all), but the browser is
> expecting a proper HTML page

Not necessarily.

> with (at least) a proper HTML header.

CGI header.

> When the CGI program exits without providing the browser some valid
> HTML, the browser complains.

The server complains. It generates an error page which the browser
displays perfectly normally.

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.            benmorrow@tiscali.co.uk


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

Date: Wed, 19 Jul 2006 17:16:36 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: tuff problem of the day for linux
Message-Id: <2c6sb294j2j7rrl3h7uh04bufhajlp8tv2@4ax.com>

On 18 Jul 2006 16:41:45 -0700, "gavino" <bootiack@yahoo.com> wrote:

>> > 1 add 1 line to config file
>> > 2 restart backup client
>> > 3 do for all 30 servers over ssh
>> > 4 do in a script without having to goto each server and login
>>
>> 1. Write a subroutine that does [task] to one computer
>> 2. Put names of all machines in an array
>> 3. loop over array and call sub for each element
>> 
>> To put the thread on topic, search CPAN for SSH

>regular linux redhat ent 4
>text files

1. *Please* do not top post: it forced me to do more editing for
clarity, that logically and operationally and would have fit better on
your part.

2. How do the last two lines correlate to 1.-3. and the additional,
good, advice given above?


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, 19 Jul 2006 17:16:37 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: tuff problem of the day for linux
Message-Id: <qj6sb29540vlstsinfmbgbhcohe5tfaqum@4ax.com>

On 18 Jul 2006 16:06:41 -0700, "gavino" <bootiack@yahoo.com> wrote:

>regular linux redhat ent 4
>text files

Huh?!?

(ditto as my other reply)


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: 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 9499
***************************************


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