[24101] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6295 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 23 14:05:41 2004

Date: Tue, 23 Mar 2004 11:05:08 -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           Tue, 23 Mar 2004     Volume: 10 Number: 6295

Today's topics:
    Re: Attempt to free unrefferenced scalar: <tassilo.parseval@rwth-aachen.de>
    Re: Attempt to free unrefferenced scalar: <jcanfield@tshmail.com>
    Re: Attempt to free unrefferenced scalar: <remorse@partners.org>
    Re: Attempt to free unrefferenced scalar: <jwillmore@remove.adelphia.net>
    Re: BigInt.pm acting dumb, or is it me? (Anno Siegel)
    Re: Building Perl with Open Watcom <mnieuw@zap.dontincludethis.a2000.nl>
    Re: converting an evaluated expression to a literal <ittyspam@yahoo.com>
    Re: converting an evaluated expression to a literal (Anno Siegel)
    Re: Counting elements in array <remorse@partners.org>
    Re: Counting elements in array <nobull@mail.com>
        directory properties (Andy)
    Re: emacs cperl-mode: indentation and so on... (Randal L. Schwartz)
    Re: How to determine the path of a module? (Peter Scott)
    Re: How to determine the path of a module? (Randal L. Schwartz)
    Re: installing CPAN module <nowhere@somewhere.com>
    Re: Matching between blank lines (Anno Siegel)
    Re: Perl upgraded = problem resurfacing (chris)
    Re: Perl upgraded = problem resurfacing <tadmc@augustmail.com>
    Re: Perl upgraded = problem resurfacing <jurgenex@hotmail.com>
        Perl web Link Checker <david@tvis.co.uk>
    Re: Printing in Perl <jluis@agujero-negro.escomposlinux.org>
    Re: Regular Expressions Question <roel-perl@st2x.net>
    Re: working example File::Taill (GreenLight)
    Re: working example File::Taill <bmb@ginger.libs.uga.edu>
    Re: working example File::Taill <tadmc@augustmail.com>
    Re: working example File::Taill <ittyspam@yahoo.com>
    Re: working example File::Taill <abaugher@esc.pike.il.us>
    Re: zip backup via ftp <jwillmore@remove.adelphia.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Mar 2004 11:17:19 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Attempt to free unrefferenced scalar:
Message-Id: <c3p6bv$hag$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Joe Smith:

> Jim Canfield wrote:
> 
>> Attempt to free unrefferenced scalar: SV 0x1e20874
> 
> That's a bug.  From the command line, use
> 
>    perlbug -s "Attempt to free unreferenced scalar: SV 0x1e20874"
> 
> to submit a bug report.  Be sure to copy-and-paste the relevant
> data, as re-typing is prone to typos (like the "ff" in the
> quoted line above).

It might not be a bug in perl. It could also be a problem with a module
not properly using weak references. I'd first make sure that this is not
the case here (by maybe asking the author of the module in question)
before submitting a report.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Tue, 23 Mar 2004 10:23:24 -0600
From: "Jim Canfield" <jcanfield@tshmail.com>
Subject: Re: Attempt to free unrefferenced scalar:
Message-Id: <1060p3ufd1dddd2@corp.supernews.com>


"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
news:c3p6bv$hag$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach Joe Smith:
>
> > Jim Canfield wrote:
> >
> >> Attempt to free unrefferenced scalar: SV 0x1e20874
> >
> > That's a bug.  From the command line, use
> >
> >    perlbug -s "Attempt to free unreferenced scalar: SV 0x1e20874"
> >
> > to submit a bug report.  Be sure to copy-and-paste the relevant
> > data, as re-typing is prone to typos (like the "ff" in the
> > quoted line above).
>
> It might not be a bug in perl. It could also be a problem with a module
> not properly using weak references. I'd first make sure that this is not
> the case here (by maybe asking the author of the module in question)
> before submitting a report.
>
Okay, I have decided this is a problem with the MIME::Lite module.  I have
reduced the code to a small example, and I'm still gettting the error
whenever MIME::lite is combined with a mysql DB selectall_hashref.  I
haven't tried other types of selects though.

Rather than continue trying to figure it out, I've decided to look for
another module that handles simple smtp sends.  Any suggestions??




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

Date: Tue, 23 Mar 2004 12:00:06 -0500
From: Richard Morse <remorse@partners.org>
Subject: Re: Attempt to free unrefferenced scalar:
Message-Id: <remorse-CE4EC4.12000623032004@plato.harvard.edu>

In article <1060p3ufd1dddd2@corp.supernews.com>,
 "Jim Canfield" <jcanfield@tshmail.com> wrote:

> Rather than continue trying to figure it out, I've decided to look for
> another module that handles simple smtp sends.  Any suggestions??

I find that Mail::Sender works for all my needs.

HTH,
Ricky


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

Date: Tue, 23 Mar 2004 13:09:15 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Attempt to free unrefferenced scalar:
Message-Id: <pan.2004.03.23.18.09.13.564793@remove.adelphia.net>

On Mon, 22 Mar 2004 15:01:12 -0600, Jim Canfield wrote:

[ ... ]

> #test simple e-mail
> 
> 
> my $mail = MIME::Lite->new(
> From =>'test@myhost.com',
> To =>'fake@fake.com',
> Subject =>'test message',
> Data =>"test"
> );
> $mail->send("smtp", 'smtp.fake.net');
> 
> This is being added to the bottom of code that looks like this..
> 
> # Connect to the database
> my $dbh = DBI->connect( "dbi:$driver:database=$db;$host", "$username",
> "$password",
> {
> RaiseError => 1,
> AutoCommit => 0
> }
> )or die "Can't connect to Mysql database: $DBI::errstr\n";
> 
> #Get hash
> 
> my $set = $dbh->selectall_hashref("SELECT...."key");
> 
> 
> $dbh->disconnect();
> 
> What am I missing? The two part are totally unrelated, howver if I
> comment out the $mail send line the entire script runs fine...well
> except for sending an e-mail.

Have you tried to use each module in separate code?  In other words, have
you tried to use *just* MIME::Lite in a script and *just* DBI in a script?
 If so, did you experience any issues?  I suggest this because there may
 be an issue with with one of the modules.  To find out which one, you
 need to try each out on it's own - process of elimination as it were.
 Commenting out the code in the original script is not a bad idea - but,
 depending upon what else is in the code, there may be other issues.

You may also consider re-installing each module - just to be sure and
*after* trying each one out individually.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
If a 6600 used paper tape instead of core memory, it would use up
tape at about 30 miles/second.   -- Grishman, Assembly Language
Programming 


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

Date: 23 Mar 2004 12:28:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: BigInt.pm acting dumb, or is it me?
Message-Id: <c3paib$853$2@mamenchi.zrz.TU-Berlin.DE>

Steve The Geek <slkleine@hotmail.com> wrote in comp.lang.perl.misc:
> Environment: Win32 with Open Perl IDE, ActiveState Perl latest stable
> rev.
> relevant modules: Net::SNMP, Math:BigInt
> 
> I'm attempting to use Net::SNMP to alter the system.sysLocation.0 OID
> on all our servers.
> 
> When compiling, Net::SNMP gets to BigInt.pm and hangs there, devouring
                            ^^^^^^^^^^^^^^^^^

> all the memory and processor it can until forced termination.

Are you saying that Net::SNMP uses Math::BigInt?  They'd make a strange
couple, and v4.1.2 of Net::SNMP doesn't.

Or are you loading Math::BigInt?  If so, are you doing so before or after
"use Net::SNMP"?  Math::BigInt overloads arithmetic operations and
calculations could significantly slow down after it is loaded.

> I've uninstalled & reinstalled Math::Bigint from two different
> sources, but no joy.
> 
> The communications log from OpenPerl IDE looks like this (will wrap):
> 
> 20040322133223417: Dispatching DM_START_REQ: DEC_OK
> 20040322133226161: Receiving DM_MODULE_LOADED_REP: C:\Documents and
> Settings\All Users\Start Menu\Programs\Perl\perl5db.pl
> 20040322133226502: Receiving DM_MODULE_LOADED_REP:
> C:\Perl\lib\overload.pm
> 20040322133226552: Receiving DM_MODULE_LOADED_REP:
> C:\Perl\lib\constant.pm
> 20040322133226682: Receiving DM_MODULE_LOADED_REP:
> C:\Perl\lib\integer.pm
> 20040322133226732: Receiving DM_MODULE_LOADED_REP:
> C:\Perl\lib\Math\BigInt.pm

I don't know OpenPerl IDE from Adam, but the last message sounds like
Math::BigInt *has* been loaded and it hangs afterwards.

> Even reducing the script to this snippet hangs on compile:
> 
> use strict;
> use warnings;
> use Net::SNMP;
> 
> And here's the kicker -- that small snippet works at runtime!

Hmmm?  If it hangs at compiletime (it doesn't for me), how does it
ever reach runtime?

> Any explanation for this admittedly weird behavior?

Show a minimal program that exhibits the behavior.  From your description
it isn't clear what it happening when.

Anno


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

Date: 23 Mar 2004 12:38:25 GMT
From: Mat Nieuwenhoven <mnieuw@zap.dontincludethis.a2000.nl>
Subject: Re: Building Perl with Open Watcom
Message-Id: <Xns94B58B590DC5Emnieuwzapdontinclude@195.129.110.143>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in
news:c3np13$agb$1@agate.berkeley.edu: 

<snip>

>> As I said, this is only an uneducated guesswork on my side; I meant
>> all the POSIXish stuff which is AFAIK missing in VAC: what I can
>> immediately remember is exec() (which is used much more frequently
>> than fork())

Watcom has a number of exec() funtions: execl, execle, execlp, execlpe,
execv, execve, execvp and execvpe, plus their wide-char equivalents. It
this what you mean? 

>> an ability to treat a socket as a file descriptor

This I don't know. For OS/2 at least you have separate calls for dealing
with sockets (like send/receive), I don't know if normal file calls
(write/read) would work. 

>> some minor-but-tedious stuff auto-translation of /dev/tty and
>> /dev/null, etc.

This is not Posix stuff, surely?

>> Doing tell()/seek() on text files is a problem with many compilers as
>> well. 

You refer to the CR/LF problems when a file is opened in text mode?.
Don't know how Watcom behaves here, I've never tried it, I tend to open
files binary. Do you have a test case? 

>> "Reliable" treatment of ^Z in text files?

What is supposed to happen when a ^Z is encountered? Normally it would
be the last char of a file added by bad editors, but what if I paste it
in the middle? 

>> sbrk() (optional for perl, but may improve functionality a lot)?

Watcom does have a sbrk. Under non-DOS, it returns a newly allocated
block of memory (rounded up to a multiple of 4k). Is this the one you
mean?

>> Reliable command-line argument quoting/dequoting and globbing (so
>> that arguments to spawnve() correspond 1-to-1 to argv[] array)?

There is no cmd line parsing in Watcom as far as I know. Are you
referring to the fact if getopt is part of the clib? 

>> wait()?

Watcom's wait returns the exit status and process ID of the first child
process that terminates. 

>> alarm()?

Not present in Watcom at the moment. Doesn't this send a particular
signal to the process after a specified time? In the list of signals
supported by Watcom (7 plus 3 OS/2 specific) I see nothing that looks
like an alarm signal. 

>> select() on many kinds of file descriptors?

select isn't in Watcom libs, it is part an OS-supplied lib. So I think
it is unlikely to work on other than socket handles. 

>> The fact is that Perl is (together with other uses) a glue to
>> system's functionality, and POSIX is a very convenient common
>> denominator.  So a lot of available Perl software assumes that the
>> current perl executable is capable of POSIXish behaviour.
>> 
>> Perl build process is very configurable, and is able to auto-detect
>> most of capabilities of the current build environment.  It should not
>> be hard to compile a build of perl with any (no matter how stupid)
>> compiler.  The problems with the build will be twofold:
>> 
>>  a) as I explained before, a lot of Perl scripts will not work with
>>     this build.
>> 
>>  b) *a lot* of stuff in the test suite will fail, and it will be very
>>     hard to distinguish the bugs of the build environment (worsened
>>     by the possible bugs in the auto-detection phase) versus the
>>     restrictions of the build environment not taken into account by
>>     the test suite.
>> 
>> To fix b), one needs to sifter through all the test suite failures,
>> and update the test suite to take into account all the new
>> restrictions coming with this new build environment.
>> 
>> To fix a) one needs to sifter through each new Perl script and
>> "improve" it by changing all the "POSIXish" stuff (like "/dev/null")
>> to the "portable" one (like File::Spec->null().  I put "improve" in
>> quotes since this *is* an improvement in the portability of the
>> script, but is a step back in maintainability of the script due to
>> increase in the amount of code).
>> 
>> From my POV, it is much easier to fix this on the level of perl guts;
>> this is the design goal of my OS/2 port; e.g., it uses a
>> Bourne-syntax shell for those system()/exec()s which require shell,
>> as opposed to %COMSPEC%.
>> 
>> > From what you say, it appears that a Win32 based Perl is missing
>> > 50% from an EMX one?
>> 
>> The largest gap of (non Cygwin) perls on Window is a botched
>> emulation of fork() - which EMX does almost perfectly.  BTW, the 50%
>> number I gave was related to "easy to convert from Win32 branches";
>> the remaining 50% is technically possible, but (I think) would
>> require some new code.

Hm. Watcom doesn't have a fork. I'm not sure if it should be added.
Maybe in the interest of portability. 

Mat Nieuwenhoven


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

Date: Tue, 23 Mar 2004 11:13:12 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: converting an evaluated expression to a literal
Message-Id: <20040323110915.W21521@dishwasher.cs.rpi.edu>

On Fri, 19 Mar 2004, Anno Siegel wrote:

> Paul Lalli  <ittyspam@yahoo.com> wrote in comp.lang.perl.misc:
> > On Thu, 18 Mar 2004, Ashkan wrote:
> >
> > > Hi,
> > >
> > > I'm performing pattern substitution and I'm having some problems when
> > > my pattern contains the following structure: "[3]".
> > >
> > > Here is a snippet of my code:
> > >
> > > while ($count ne 0) {
> > >     $file[$count] =~ s#$value[$val_count]#sub[$val_count]#g;
> > >     $count--;
> > > }
> > > Is there any way for the $value[$val_count] to be evaluated, then the
> > > output be treated as a literal?
> >
> > s/\Q$value[$val_count]\E/sub[$val_count]/g;
> >
> > the \Q ... \E syntax escapes (backslashes) all 'special' characters in the
> > string, rendering [ and ] as plain old brackets, so they no longer have
> > their special meaning in a regexp.
>
> Did you test that?  If it worked that way, \Q would also quote "$",
> so no interpolation would happen at all.
>
> Variable interpolation happens before \Q is applied.  If it didn't,
> the main application of \Q to protect metacharacters in interpolated
> strings wouldn't work.
>
> To have "$value" in "$value[$val_count]" to be interpreted as a scalar
> variable, you need explicit backslashes before the brackets:
>
>     s/$value\[$val_count\]/sub[$val_count]/g;
>
> Depending on the content of $value and $val_count, \Q may also be
> needed.


I understand perfectly well how \Q...\E works, thank you.  The OP said he
wanted $value[$val_count] to be evaluated, and the result of that
evaluation to be treated as a literal.  I took this to mean that he had an
array @value, and that the $val_count'th position of that array contained
special characters (such as []) that were being treated as 'special' by
the RegExp parser. (ie, that he was getting a character class where he
didn't want one).  Therefore, I told him to meta-escape the results of the
variable interpolation so that the [] would be treated as literal brackets
as opposed to character class delimiters.

If I misunderstood the OP's original intent, I apologize.

Paul Lalli


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

Date: 23 Mar 2004 16:39:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: converting an evaluated expression to a literal
Message-Id: <c3pp7j$lpi$1@mamenchi.zrz.TU-Berlin.DE>

Paul Lalli  <ittyspam@yahoo.com> wrote in comp.lang.perl.misc:
> On Fri, 19 Mar 2004, Anno Siegel wrote:
> 
> > Paul Lalli  <ittyspam@yahoo.com> wrote in comp.lang.perl.misc:
> > > On Thu, 18 Mar 2004, Ashkan wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm performing pattern substitution and I'm having some problems when
> > > > my pattern contains the following structure: "[3]".
> > > >
> > > > Here is a snippet of my code:
> > > >
> > > > while ($count ne 0) {
> > > >     $file[$count] =~ s#$value[$val_count]#sub[$val_count]#g;
> > > >     $count--;
> > > > }
> > > > Is there any way for the $value[$val_count] to be evaluated, then the
> > > > output be treated as a literal?
> > >
> > > s/\Q$value[$val_count]\E/sub[$val_count]/g;
> > >
> > > the \Q ... \E syntax escapes (backslashes) all 'special' characters in the
> > > string, rendering [ and ] as plain old brackets, so they no longer have
> > > their special meaning in a regexp.
> >
> > Did you test that?  If it worked that way, \Q would also quote "$",
> > so no interpolation would happen at all.
> >
> > Variable interpolation happens before \Q is applied.  If it didn't,
> > the main application of \Q to protect metacharacters in interpolated
> > strings wouldn't work.
> >
> > To have "$value" in "$value[$val_count]" to be interpreted as a scalar
> > variable, you need explicit backslashes before the brackets:
> >
> >     s/$value\[$val_count\]/sub[$val_count]/g;
> >
> > Depending on the content of $value and $val_count, \Q may also be
> > needed.
> 
> 
> I understand perfectly well how \Q...\E works, thank you.

Heyhey.  No harm meant.

>                                                           The OP said he
> wanted $value[$val_count] to be evaluated, and the result of that
> evaluation to be treated as a literal.  I took this to mean that he had an
> array @value, and that the $val_count'th position of that array contained
> special characters (such as []) that were being treated as 'special' by
> the RegExp parser. (ie, that he was getting a character class where he
> didn't want one).

Allright, that's another way to read the question, probably more plausible.
Unfortunately, the OP seems to have left us guessing.

Anno


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

Date: Tue, 23 Mar 2004 11:53:03 -0500
From: Richard Morse <remorse@partners.org>
Subject: Re: Counting elements in array
Message-Id: <remorse-90A85F.11530223032004@plato.harvard.edu>

In article <u9r7vkexs4.fsf@wcl-l.bham.ac.uk>,
 Brian McCauley <nobull@mail.com> wrote:

>       !$saw{$vir}++;

Hi!  Why the '!'?  You aren't doing any logical tests here...

Thanks,
Ricky


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

Date: 23 Mar 2004 17:29:12 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Counting elements in array
Message-Id: <u9lllrfp5j.fsf@wcl-l.bham.ac.uk>

Richard Morse <remorse@partners.org> writes:

> In article <u9r7vkexs4.fsf@wcl-l.bham.ac.uk>,
>  Brian McCauley <nobull@mail.com> wrote:
> 
> >       !$saw{$vir}++;
> 
> Hi!  Why the '!'?

Typo. ( There was a ! in the OP's code, I neglected to remove it when
I rearranged the code).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 23 Mar 2004 09:17:47 -0800
From: andreasmaier@nurfuerspam.de (Andy)
Subject: directory properties
Message-Id: <ee11c0d9.0403230917.90e959a@posting.google.com>

Hi! 

I would like to check the properties of some of my directories of my
Win NT using perl. Does anybody know if there is a possibility to get
properties like the right assignment for definite groups of a
filesystem folder?

 
Thanks,
  Andy


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

Date: Tue, 23 Mar 2004 13:41:27 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: jamesk@homeric.co.uk
Subject: Re: emacs cperl-mode: indentation and so on...
Message-Id: <3b9fd932b92109218388d35ff7268c20@news.teranews.com>

>>>>> "James" == James Keasley <me@privacy.net> writes:

James> Dumping the following lisp into your ~/.emacs file will tell
James> emacs to use Cperl-mode instead of perl-mode, and turns on a
James> couple of the other handy functions cperl-mode keeps up its sleeve.

James> ;; Use Cperl-mode in preference to perl-mode (added 2003/11/27)
James> (defun modify-alist (alist-symbol key value &optional search-cdr)
James>   (let ((alist (symbol-value alist-symbol)))
James>     (while alist
James>       (if (eq (if search-cdr
James> 		  (cdr (car alist))
James> 		(car (car alist))) key)
James> 	  (setcdr (car alist) value)
James> 	(setq alist (cdr alist))))))

James> (modify-alist 'interpreter-mode-alist 'perl-mode 'cperl-mode t)
James> (modify-alist 'auto-mode-alist        'perl-mode 'cperl-mode t)

I just did this instead:

(while (let ((pm (rassoc 'perl-mode auto-mode-alist)))
  (and pm (setcdr pm 'cperl-mode))))
(while (let ((pm (rassoc 'perl-mode interpreter-mode-alist)))
  (and pm (setcdr pm 'cperl-mode))))

If I were a bear of slightly larger brain, I could probably collapse
this into a loop over the two items as well.  My emacs-lisp-fu has
atrophied since the early days when I wrote pp.el and dozens of other
Very Cool things.  My Perl-fu has taken its place in my brain.

print "Just another Perl and emacs-lisp hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Tue, 23 Mar 2004 14:22:33 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: How to determine the path of a module?
Message-Id: <JKX7c.890564$ts4.153009@pd7tw3no>

In article <4136dc4479d10b17fae79b3460186274@news.teranews.com>,
 merlyn@stonehenge.com (Randal L. Schwartz) writes:
>>>>>> "James" == James Willmore <jwillmore@remove.adelphia.net> writes:
>James> If, for some reason, you need to know the location of a '.pm' file, use
>James> perldoc with the '-l' option.
>
>James> For example: perldoc -l CGI
>James> will give the location of the CGI.pm file.
>
>This works as long as the docs are embedded.  If there are no embedded
>docs, the command fails.  If the docs are in a separate ".pod" file,
>you get that path instead.

perldoc -mv will display the module source itself and immediately
prior to doing so will show you where it found it.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/


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

Date: Tue, 23 Mar 2004 17:41:31 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to determine the path of a module?
Message-Id: <7cd9206a5d1ad8accbc24b39afca604e@news.teranews.com>

>>>>> "Peter" == Peter Scott <peter@PSDT.com> writes:

Peter> perldoc -mv will display the module source itself and immediately
Peter> prior to doing so will show you where it found it.

Once again, only as long as (a) there actually is a doc in the module,
anbd (b) it's not a separate .pod file.  Otherwise, you get the pod
file or nothing.

"perldoc" prefers docs, not code.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Tue, 23 Mar 2004 13:31:57 GMT
From: foobardude <nowhere@somewhere.com>
Subject: Re: installing CPAN module
Message-Id: <h%W7c.3661$Uh5.42@nwrdny01.gnilink.net>

James Willmore wrote:

> [ don't top post - it's rude ]

My apologies. 

> 
> On Sat, 20 Mar 2004 15:18:06 +0000, foobardude wrote:
> 
>> James Willmore wrote:
>> 
>>> On Fri, 19 Mar 2004 21:14:49 +0000, foobardude wrote:
> 
>>
---------------------------------------------------------------------------
>>>> Did not find GP/PARI build directory around. Do you want to me to
>>>> fetch GP/PARI automatically?
>>>>   (If you do not, you will need to fetch it manually, and/or direct me
>>>>   to
>>>>    the directory with GP/PARI source via the command-line option
>>>> paridir=/dir)
>>>> Make sure you have a large scrollback buffer to see the messages.
>>>> Fetch? (y/n, press Enter) Can't open PREFIX=~/perl5lib/: No such file
>>>> or directory at utils/Math/PariBuild.pm line 148. Can't open
>>>> LIB=~/perl5lib/lib: No such file or directory at
>>>> utils/Math/PariBuild.pm line 148.
> 
> Okay.  It appears that the module did not find the pari headers and
> library.  I *suggest* that an admin install pari (the library, *not* the
> module) for you.  I have no clue what will happen if you install pari
> (again, library, not module) as a regular user.
> 

Getting the admin to install anything here takes weeks unfortunately
so that's not a viable option... :(

> And, as I pointed out before ... you might want to change the PREFIX to a
> full path versus using the '~' in the path.  I realize you're using your
> home directory to install to, but, maybe, CPAN is seeing '~' as a real
> directory instead of what the shell you use interprets '~' to mean.
> 
>>>> Can't open INSTALLMAN1DIR=~/perl5lib/man1: No such file or directory
>>>> at utils/Math/PariBuild.pm line 148.

I did that too, without success. It still keeps complaining about 
a missing /home/user/perl5lib/lib directory which is definitely there
for example. 

>>> Have you tried to install without the CPAN shell?  This *may* work for
>>> you.  OTOH, the install may crap again, but it's worth a shot.  One way
>>> to do this is (from the CPAN shell) type 'look Math::Pari' (which gets
>>> you out of the CPAN shell and into where the module tarball was
>>> extracted), then 'perl Makefile.PL', 'make', 'make test', and finally
>>> 'make install'. Make sure you read the messages during each step to see
>>> if all went well.

It goes well until 'make install' at which point it bombs out because it
wants to install under some system directory but then maybe that was
expected because I never specified (not that I know how) to install under
some other local directory when manually compiling a module. 

C. 



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

Date: 23 Mar 2004 11:32:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Matching between blank lines
Message-Id: <c3p77r$853$1@mamenchi.zrz.TU-Berlin.DE>

gibbering poster <noone@nowhere.com> wrote in comp.lang.perl.misc:
> Sorry in advance if I missed the part of the fm that I was supposed to
> read...
> 
> My question is: How do I take a multi-line string, and match the data
> between blank lines?
> 
> Take the following:
> 
> __BEGIN-STRING__
> blahblahblahblah
> 1234: --dfs-ffjlkj
> 
> THIS IS WHAT I WANT TO MATCH
> 
> JUnkjunkjunk
> 12o3iu
> __END-STRING__
> 
> How would I match the text between the 2 blank with a regular
> expression?  I.e. 'THIS IS WHAT I WANT TO MATCH' ?
> 
> I tried /^$(.*?)^$/m ....
> 
> Thanks in advance for help

What is supposed to happen when there are three or more blank lines?
What if there is only one?

If the string is originally read from a file, consider reading it in
paragraph mode.  That will directly give you chunks delimited by
empty lines.

Anno


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

Date: 23 Mar 2004 07:09:44 -0800
From: fast_rabbit@gmx.ch (chris)
Subject: Re: Perl upgraded = problem resurfacing
Message-Id: <35b33fc4.0403230709.730e51c8@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc5v8fn.ain.tadmc@magna.augustmail.com>...
> Grant <emailgrant123@yahoo.com> wrote:
> 
> > One more thing: The "<?xml" characters will always be at the very
> > beginning of the response.  Is there a better way to write:
> > 
> > if ($response =~ /^<\?xml/ ) {
> > 
> > knowing that? 
> 
> 
> Regexes are not the Right Tool for constant strings:
> 
>    if ( index($response, '<?xml') == 0 ) {

What is the reasoning behind this? Are regexes slower / using more
resources?

Just wondering

cheers
Chris


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

Date: Tue, 23 Mar 2004 10:04:41 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl upgraded = problem resurfacing
Message-Id: <slrnc60o0p.1i5.tadmc@magna.augustmail.com>

chris <fast_rabbit@gmx.ch> wrote:
> Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc5v8fn.ain.tadmc@magna.augustmail.com>...
>> Grant <emailgrant123@yahoo.com> wrote:
>> 
>> > One more thing: The "<?xml" characters will always be at the very
>> > beginning of the response.  Is there a better way to write:
>> > 
>> > if ($response =~ /^<\?xml/ ) {
>> > 
>> > knowing that? 
>> 
>> 
>> Regexes are not the Right Tool for constant strings:
>> 
>>    if ( index($response, '<?xml') == 0 ) {
> 
> What is the reasoning behind this? Are regexes slower / using more
> resources?


Yes to both.


> Just wondering


m// has to build a state machine and execute it (sans optimizations).

index() can do a straightforward search for the constant string.


See also:

   How Regexes Work:

      http://www.plover.com/~mjd/perl/Regex/


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


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

Date: Tue, 23 Mar 2004 16:24:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl upgraded = problem resurfacing
Message-Id: <kxZ7c.214$HX2.146@nwrddc01.gnilink.net>

Tad McClellan wrote:
> chris <fast_rabbit@gmx.ch> wrote:
>> Tad McClellan <tadmc@augustmail.com> wrote in message
>>> Regexes are not the Right Tool for constant strings:
>>
>> What is the reasoning behind this? Are regexes slower / using more
>> resources?
>
> Yes to both.
> m// has to build a state machine and execute it (sans optimizations).
> index() can do a straightforward search for the constant string.

Not to mention that REs are more difficult to write then a plain string:
- do I have to escape the dot?
- why doesn't it find the backslash?

jue




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

Date: Tue, 23 Mar 2004 14:34:49 +0000
From: zzapper <david@tvis.co.uk>
Subject: Perl web Link Checker
Message-Id: <mji060dk9uep9hkbov02l3li4cppskl3i2@4ax.com>

Hi,

I've tried using http://www.linklint.org but this hasn't been updated
since 2001? It doesn't cope with JavaScript links (AFAIK). Is there
any other project? 


zzapper (vim, cygwin, wiki & zsh)
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips


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

Date: Tue, 23 Mar 2004 15:05:07 -0000
From: José Luis Pérez Diez <jluis@agujero-negro.escomposlinux.org>
Subject: Re: Printing in Perl
Message-Id: <VA.0000075e.01699efd@agujero-negro.escomposlinux.org>

In article <slrnc5knui.jls.bsoist@otaku.freeshell.org>, Bill Soistmann 
wrote:
> You are missing the point to my original post
> 
> I try -- print "help me"; 
> that doesn't work.
>
Search it in google this is the your first message in any order google 
can find:
http://groups.google.com/groups?as_epq=print%20%22help%20me%22%3B&safe=
images&ie=UTF-8&oe=UTF-8&as_uauthors=Soistmann&lr=&hl=en

also with 
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=+print+he
lp+me+author%3ASoistmann&btnG=Google+Search



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

Date: 23 Mar 2004 17:21:10 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: Regular Expressions Question
Message-Id: <slrnc60sel.fam.roel-perl@195-86-124-242.dsl.easynet.nl>

On Tue, 23 Mar 2004 at 03:25 GMT, Aaron Baugher <abaugher@esc.pike.il.us> wrote:
> Tore Aursand <tore@aursand.no> writes:
> 
>> This one will print all lines, except those beginning with 'Diaplay':
>>
> That prints only lines that match.  To print the ones that don't
> match:
> 
>    while ( <FILE> ) {
>        print unless ( /^Display/ );
>    }
> 

Given the optimization advice given elsewhere today that would be

  while ( <FILE ) {
      print unless index($_, 'Display') == 0;
  }

;-)


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

Date: 23 Mar 2004 06:37:55 -0800
From: google@milbaugh.com (GreenLight)
Subject: Re: working example File::Taill
Message-Id: <c4b60ce1.0403230637.2862339a@posting.google.com>

ctcgag@hotmail.com wrote in message news:<20040322120327.272$KG@newsreader.com>...
> 
> Why would I want to find all the variables in that unit in a single place?
> 
> If I wanted that, wouldn't grep 'my' work just fine?
> 
> Xho

Ah, you are assuming the existence of "grep" 8^)
Remember, Perl is bigger than *NIX...

--
my real address is perl - at - milbaugh - dot - com


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

Date: Tue, 23 Mar 2004 10:53:42 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: working example File::Taill
Message-Id: <Pine.A41.4.58.0403231049580.7556@ginger.libs.uga.edu>

On Tue, 23 Mar 2004, GreenLight wrote:

> ctcgag@hotmail.com wrote in message news:<20040322120327.272$KG@newsreader.com>...
> >
> > Why would I want to find all the variables in that unit in a single place?
> >
> > If I wanted that, wouldn't grep 'my' work just fine?
> >
> > Xho
>
> Ah, you are assuming the existence of "grep" 8^)
> Remember, Perl is bigger than *NIX...

perl -ne'print if/my/' file

Regards,

Brad


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

Date: Tue, 23 Mar 2004 10:08:58 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: working example File::Taill
Message-Id: <slrnc60o8q.1i5.tadmc@magna.augustmail.com>

GreenLight <google@milbaugh.com> wrote:
> ctcgag@hotmail.com wrote in message news:<20040322120327.272$KG@newsreader.com>...
>> 
>> Why would I want to find all the variables in that unit in a single place?
>> 
>> If I wanted that, wouldn't grep 'my' work just fine?
>> 
>> Xho
> 
> Ah, you are assuming the existence of "grep" 8^)


If they have perl installed, then they _have_ "grep",
but it is spelled like this:

   perl -ne 'print qq($ARGV: $_) if /\bmy\b/' *.pl

:-)


> Remember, Perl is bigger than *NIX...


Remember, Perl can do most things that the *NIX utilities can do.  :-)

As in:

   http://language.perl.com/ppt/


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


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

Date: Tue, 23 Mar 2004 11:58:17 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: working example File::Taill
Message-Id: <20040323115432.V21521@dishwasher.cs.rpi.edu>

On Mon, 22 Mar 2004, Aaron Baugher wrote:

> Paul Lalli <ittyspam@yahoo.com> writes:
>
> > The only time the defined() would return a different response than
> > the simple boolean test is if the last line of the file contained
> > just the string "0" (without a newline).  In this case, the boolean
> > test would return false, but a defined() test would return true.
>
> The last line could also be blank (just a newline),

"\n" is not false.

> or "000000"

"000000" is not false.

> or "0000.0000",

"0000.0000" is not false.

> or anything else that evaluates as false.

0, "0", "", and undef are false.  Nothing else.  Since the operation in
question is reading a string, 0 and undef are ruled out.  Since all lines
(with the possible exception of the last line) will have a \n attached, ""
is ruled out.  Therefore, as I said, the only possible time defined() will
give a different answer than boolean truth is when the last line of the
file contains the single character "0".

> Probably best to stick with defined() here.

If and only if the above case is something you think you're going to see.

Paul Lalli


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

Date: Tue, 23 Mar 2004 12:51:00 -0600
From: Aaron Baugher <abaugher@esc.pike.il.us>
Subject: Re: working example File::Taill
Message-Id: <86wu5b5re3.fsf@cail.baugher.pike.il.us>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

> None of these evaluate to false.  A single "0" without a terminating
> newline is the only type of line that may be missed.  That is really
> a malformed line, so it is customary to simply check for truth.

Whoops; learned something today.  I thought anything which equaled
zero, like "0000.000", was false.  Just tested it, and you're right.


-- 
Aaron
abaugher@esc.pike.il.us



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

Date: Tue, 23 Mar 2004 13:18:55 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: zip backup via ftp
Message-Id: <pan.2004.03.23.18.18.53.451422@remove.adelphia.net>

On Tue, 23 Mar 2004 21:01:54 +1000, Gregory Toomey wrote:


> As a mimumum you sell need to run Perl, be able to edit files, & need a web
> server. I cant see how you do this with webtv - you need a PC at a minimum,
> and perhaps a hosting service.

[coming in late to the thread ...]

Why does the OP *need* a web server or web host in order to use Perl?

PC - yes.  web server / hosting service - no.  *Not* a requirement to run
Perl scripts.

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"OK, now let's look at four dimensions on the blackboard."   -- Dr. Joy 



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

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


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