[25254] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7499 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 9 06:05:45 2004

Date: Thu, 9 Dec 2004 03:05:10 -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           Thu, 9 Dec 2004     Volume: 10 Number: 7499

Today's topics:
    Re: Can't find Cyrus::Imap module. <kalinaubears@iinet.net.au>
    Re: Can't find Cyrus::Imap module. <sam.wun@authtec.net>
    Re: examples using PDF::Template <constantin.wiemer@infineon.com>
        get startup / running time of a process? <xxxx@yyyy.zzzz>
    Re: get startup / running time of a process? <nospam@bigpond.com>
    Re: get startup / running time of a process? <spamtrap@dot-app.org>
    Re: get startup / running time of a process? <dog@dog.dog>
    Re: How to detect an undefined SV* value in XS? <tassilo.von.parseval@rwth-aachen.de>
    Re: HTML2JPEG <romm@empire.tau.ac.il>
    Re: Maximum length of hash key (Peter Corlett)
        Parsing Huge Files <ihatespam@hotmail.com>
        Perl to MySQL? <sam.wun@authtec.net>
    Re: Perl to MySQL? <sam.wun@authtec.net>
    Re: Perl to MySQL? <nospam@bigpond.com>
    Re: Perl to MySQL? <spamtrap@dot-app.org>
    Re: Perl to MySQL? <spamtrap@dot-app.org>
    Re: regular expressions problem <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: regular expressions problem <humbads1@hotmail.com>
    Re: regular expressions problem <jurgenex@hotmail.com>
    Re: regular expressions problem <spamtrap@dot-app.org>
    Re: regular expressions problem <bernard.el-haginDODGE_THIS@lido-tech.net>
    Re: why the following HereDoc print don't work? <tadmc@augustmail.com>
    Re: why the following HereDoc print don't work? <spamtrap@dot-app.org>
    Re: why the following HereDoc print don't work? <spamtrap@dot-app.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 09 Dec 2004 05:16:43 +0000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Can't find Cyrus::Imap module.
Message-Id: <41b7ef2e$0$25779$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

sam wrote:
> Hi,
> 
> I search the cpan.org website, but could not find a download link for 
> this module.
> Can anyone tell me where can I download this perl module?
> Note, this is not the same as the old IMAP::Admin module written few 
> years ago. I m looking for Cyrus::Imap.

I don't think it's on CPAN. Google turned up this:

http://www.novell.com/products/linuxpackages/enterpriseserver/s390/perl-cyrus-imap.html

Cheers,
Rob

-- 
To reply by email u have to take out the u in kalinaubears.



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

Date: Thu, 09 Dec 2004 14:28:15 +0800
From: sam <sam.wun@authtec.net>
Subject: Re: Can't find Cyrus::Imap module.
Message-Id: <cp8sr0$1pe8$1@news.hgc.com.hk>

Sisyphus wrote:

> sam wrote:
> 

> I don't think it's on CPAN. Google turned up this:
> 
> http://www.novell.com/products/linuxpackages/enterpriseserver/s390/perl-cyrus-imap.html 
> 
Sorry, I just found this module is in the perl5/site_*/Cyrus directory 
in FreeBSD.

Sam.

> 
> Cheers,
> Rob
> 


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

Date: Thu, 09 Dec 2004 08:09:55 +0100
From: Constantin Wiemer <constantin.wiemer@infineon.com>
Subject: Re: examples using PDF::Template
Message-Id: <cp8to4$o2a$1@athen03.muc.infineon.com>

botfood wrote:
> botfood wrote:
> 
>>I have a possible project I am looking into that is basically
> 
> creating
> 
>>a "mail-merge" utility that would chew through a big CSV spreadsheet
>>and merge the fields into a template to generate a big .pdf document.
>>The reason the client wants to go .pdf is to have a "print ready"
>>format.
>>--------------------------
> 
> 
> after a night of poking around, and you all's input, it looks like
> creating .pdf files on the fly is a pretty involved and painful
> process. PDF::Template has potential for what I want to do, but
> requires learning special XML syntax to set up the template, and buying
> the PDFlib for about $450. PDF::Create has some simple capabilities,
> but neither look straightforward to use in a mail-merge application as
> there are some complex issues with pagination and text position.
> Neither module had very complete docs, and I couldn't find any
> reasonably complete tutorials or examples online.
> 
> I read thru the overview and some syntax of the actual .pdf spec on the
> adobe site... and while a super simple layout might be pretty easy to
> code, it would get REAL deep real fast.
> 
> so.... just thought I'd post a followup in case somebody googles later.
> Its looking to me like its a lot easier to generate the output is a
> text, html, or other man-readable format and then use a cheap "print to
> pdf" convertor at the backend.
> 
> if there is somebody out there who has actually used PDF::Create and/or
> PDF::Template and would like to share some thoughts on the
> capabilities/limitations, ease of use, examples, etc, I still think it
> would be great to share some knowledge of these packages.
> 
> I realize that some people feel this group is for asking questions
> after you get stuck... but I HOPE there are also people out their
> interested in sharing experiences with specific packages to help others
> evaluate alternatives before investing a lot of learning time and test
> code.
> 
> d
> 

What about creating your document in Postscript and then using 
Ghostscript to convert it to PDF? Postscript is probably easier to 
create on the fly than PDF (not sure, not much experience here) and 
Ghostscript works quite well for creating PDF files. I just checked and 
there is a module PostScript::Simple on CPAN (among quite a few others) 
which might do what you want.

It is also quite simple to create a Postscript "template" with 
placeholders in it and then replace these placeholders with your actual 
data using Perl. To create such a template you can use for example a 
word processor (or spreadsheet or whatever) and save the document as 
Postscript to a file. I did something like that to provide a legacy 
application with nicely formatted reports.

Hope this helps.

Regards,

Constantin


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

Date: Wed, 8 Dec 2004 23:42:21 -0800
From: "Crom" <xxxx@yyyy.zzzz>
Subject: get startup / running time of a process?
Message-Id: <cp8vo8$jua$1@news.astound.net>

Is there a portable way of obtaining the start up and/or elapsed time
since start (which I suppose could be calculated given the start time,
so no biggy, just need the start time.)

I've been searching exhaustively in both google groups without many
leads. My target systems are Linux and Freebsd, though a portable
solution would be nice, but not necessary.

So far the only way I could find is parsing output from the ps command,
but it's a little different from system, and some show the time as Tue01
(to indicate something started @ 1 o'clock on tuesday, which is a dead
end in the sense of raw time value hunting, if you know what I mean; in
others words you can't derive ac actually date/time from a value like
that!

Any help in this would greatly be appreciated.




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

Date: Thu, 09 Dec 2004 18:45:24 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: get startup / running time of a process?
Message-Id: <31qhl4F3d8arvU1@individual.net>

Crom wrote:

> Is there a portable way of obtaining the start up and/or elapsed time
> since start (which I suppose could be calculated given the start time,
> so no biggy, just need the start time.)
> 
> I've been searching exhaustively in both google groups without many
> leads. My target systems are Linux and Freebsd, though a portable
> solution would be nice, but not necessary.
> 
> So far the only way I could find is parsing output from the ps command,
> but it's a little different from system, and some show the time as Tue01
> (to indicate something started @ 1 o'clock on tuesday, which is a dead
> end in the sense of raw time value hunting, if you know what I mean; in
> others words you can't derive ac actually date/time from a value like
> that!
> 
> Any help in this would greatly be appreciated.

In linux the /proc filesystem has lots of information.

gtoomey


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

Date: Thu, 09 Dec 2004 04:04:03 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: get startup / running time of a process?
Message-Id: <jb6dnSBKk5SeiCXcRVn-hw@adelphia.com>

Crom wrote:

> Is there a portable way of obtaining the start up and/or elapsed time
> since start (which I suppose could be calculated given the start time,
> so no biggy, just need the start time.)
> 
> I've been searching exhaustively in both google groups without many
> leads. My target systems are Linux and Freebsd, though a portable
> solution would be nice, but not necessary.

A minute of perldoc is worth an hour of Google. From 'perldoc perlvar':

$BASETIME
$^T     The time at which the program began running, in seconds since
         the epoch (beginning of 1970).  The values returned by the -M,
         -A, and -C filetests are based on this value.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 9 Dec 2004 10:05:51 +0100
From: "Peter Michael" <dog@dog.dog>
Subject: Re: get startup / running time of a process?
Message-Id: <cp94hj$7k$1@tgx093.str.allianz.de>

    Crom,

"Crom" <xxxx@yyyy.zzzz> schrieb im Newsbeitrag
news:cp8vo8$jua$1@news.astound.net...
> Is there a portable way of obtaining the start up and/or elapsed time
> since start (which I suppose could be calculated given the start time,
> so no biggy, just need the start time.)

    have a look at $^T in the perlvar man page.

        Peter




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

Date: Thu, 9 Dec 2004 10:32:02 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: How to detect an undefined SV* value in XS?
Message-Id: <slrncrg6si.1qv.tassilo.von.parseval@localhost.localdomain>

Also sprach xhoster@gmail.com:

> "jl_post@hotmail.com" <jl_post@hotmail.com> wrote:
>> Ben Morrow said:
>> >
>> > I *believe* that all you need to do is
>> > if (sv != &PL_sv_undef)
>> >
>> > If I am wrong here I would appreciate correction... :)
>>
>> I don't think that's correct.  I might be wrong, but I think that
>> &PL_sv_undef is a macro that's used when one wants to return an
>> undefined value, either by pushing it onto the return stack or setting
>> RETVAL to it, like this:
>>
>> RETVAL = &PL_sv_undef;
>>
>> Thanks to the replies of other posters, I now know of three
>> different ways to check for an undefined value:
>>
>> if (SvTYPE(sv) == SVt_NULL)  printf("Undefined");
>> # Contributed by Rob (Sisyphus):
>> if (SvANY(sv) == NULL)  printf("Undefined");
>> # Contributed by Tassilo v. Parseval:
>> if (SvOK(sv) == false)  printf("Undefined");
>>
>> Of these three methods, only SvOK is documented in "perldoc
>> perlapi", which is worth considering if portability is a concern.  But
>> I tested all three methods, and they all seem to work.
>> Thanks for all who replied!
>
> SvANY doesn't seem to work properly for me.

Of course it doesn't. It's just not the proper way to test for
undefinedness.

> It claims a variable that was once defined but is now undef as if it
> were defined.  

A variable once defined and then undefed does keep its previous value,
as can be verified easily:

    ethan@ethan:~$ perl -MDevel::Peek
    $a = 42;
    $a = undef;
    Dump($a);
    ^D
    SV = IV(0x8162f74) at 0x8160b90
      REFCNT = 1
      FLAGS = ()
      IV = 42

The IV slot is still there which means that SvANY can't be null. From a
technical point of view this is the proper way to do it as it is more
efficient to reset flags than to clean up an SV struct.

I said elsewhere to use SvOK as it will do what you want, namely check
the flags of the SV. I am not entirely sure why you insist on doing it
the hard and wrong way.

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: Thu, 9 Dec 2004 07:25:40 +0000 (UTC)
From: "Roman M. Parparov" <romm@empire.tau.ac.il>
Subject: Re: HTML2JPEG
Message-Id: <cp8ulk$vfa$1@news.iucc.ac.il>

"J?rgen Exner" <jurgenex@hotmail.com> wrote:
> Katja Zinchenko wrote:
> > Thanks for the hint, and sorry, yes, my question was too vague. What
> > I wanted to ask is: Is there a perlish way to save the contents of a
> > web page to an image file exactly the way a browser (any recent
> > browser) would render it?

> Of course. And it is so trivial that you don't even need Perl.
> Just use Lynx. It has an option to write the rendered text to a file:

> -dump
> dumps the formatted output of the default document or one specified on the 
> command line to standard out.

I suspect Katja wants to take screenshots of specific pages _including_
graphics, so lynx isn't sufficient.

> Further details see 
> http://lynx.isc.org/current/lynx2-8-5/lynx_help/Lynx_users_guide.html

> jue 



-- 
Roman M. Parparov - NASA EOSDIS project node at TAU technical manager.
Email: romm@empire.tau.ac.il		   http://www.nasa.proj.ac.il/
Phone/Fax: +972-(0)3-6405205 (work),        +972-(0)50-734-18-34 (home)
----------------------------------------------------------------------
The economy depends about as much on economists as the weather does on
weather forecasters.
                -- Jean-Paul Kauffmann


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

Date: 09 Dec 2004 10:25:36 GMT
From: abuse@dopiaza.cabal.org.uk (Peter Corlett)
Subject: Re: Maximum length of hash key
Message-Id: <41b82820$0$218$5a6aecb4@news.aaisp.net.uk>

Uri Guttman <uri@stemsystems.com> wrote:
[...]
> should be very slow as it has to copy and or each of the keys and
> you said this is large hash. the solution i posted aliases to each
> key (so no copying) and length and max are fast.

It turns out that copying in Perl isn't always as expensive as you
might think. What was that saying about premature optimisation? ;)

> for your education benchmark them (on a large hash) and post the
> results.

#!/usr/bin/perl -w
use strict;

use Benchmark ':all';

foreach my $keys (2, 10, 100, 1000, 1e4) {
  srand 1;
  my %hash;
  for (1..$keys) {
    my $key=join '',map { chr(32+rand 95) } (0..rand 40);
    $hash{$key}++;
  }
  print "\nFor $keys keys\n\n";
  cmpthese(1e6/$keys, {
	    or_keys => sub {
	      my $l;
	      $l|=$_ foreach keys %hash; $l=1+length $l;
	    },
	    or_each => sub {
	      my($l, $k);
	      $l|=$k while($k=each %hash); $l=1+length $l;
	    },
	    uri_keys => sub {
	      my @arr; for ( keys %hash ) {$arr[length $_] = defined;};
	      my $l = $#arr+1;
	    }
	   });
}
__END__

And its output (on a 400MHz PII):

For 2 keys

            Rate uri_keys  or_keys  or_each
uri_keys 27778/s       --     -26%     -55%
or_keys  37707/s      36%       --     -39%
or_each  61728/s     122%      64%       --

For 10 keys

            Rate uri_keys  or_keys  or_each
uri_keys 11669/s       --     -37%     -42%
or_keys  18450/s      58%       --      -8%
or_each  20000/s      71%       8%       --

For 100 keys

           Rate uri_keys  or_each  or_keys
uri_keys 2004/s       --     -15%     -25%
or_each  2370/s      18%       --     -12%
or_keys  2681/s      34%      13%       --

For 1000 keys

          Rate  or_each uri_keys  or_keys
or_each  241/s       --      -7%     -12%
uri_keys 260/s       8%       --      -5%
or_keys  275/s      14%       6%       --

For 10000 keys

           Rate  or_keys uri_keys  or_each
or_keys  21.8/s       --      -2%      -2%
uri_keys 22.3/s       2%       --      -0%
or_each  22.3/s       2%       0%       --


It appears that my cute golfing exercise/hack is actually faster than
your array-based approach for small hashes, but you win on larger
hashes. I'm also somewhat surprised that an each-based approach is
slower on a relatively-large 1000 key hash.

-- 
PGP key ID E85DC776 - finger abuse@mooli.org.uk for full key


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

Date: Wed, 08 Dec 2004 21:21:46 -0800
From: BigDaDDY <ihatespam@hotmail.com>
Subject: Parsing Huge Files
Message-Id: <10rft43sq3ir251@corp.supernews.com>

All,

I have a huge text file (around 700MB) that I am trying to parse.  I was 
successful, but I don't think I have done it very efficiently.  Basically 
in my program I have a hash containing some unique id numbers which are 
keyed by cartesian (x,y,z) coordinates.   

#!/usr/bin/perl -w

use strict;

my %id;

$id{"200"}{"-11"}{"199.5"} = 123456;
$id{"201"}{"-11"}{"199.5"} = 246891;
$id{"202"}{"-11"}{"199.5"} = 169245;
$id{"200"}{"-45"}{"199.5"} = 274321;

# End of example code


Here is where it is getting difficult for me.  I have 8 possible y-values, 
420 x-values and 1 z-value 

The format of my 700MB file is something like

#ID             Value
123456          200
274321          100
246891          400
169245          600
123456          300
274321          50
246891          600 #each element id occurs 24 times once for each subcase
169245          800
123456          400
274321          45
246891          800
169245          999
 .
 .
 .


What I want to do is for each unique y value, I want to create a file named 
after each y-value which looks like the following

element ID      Value(subcase1) Value(subcase2) Value(subcase3) . . .
123456          200             300     400     
246891          400             600     800
169245          600             800     999

So basically, given a fixed y and z value, loop over all x values and get 
element ids which are then searched for in the big file and reformatted 
into individual files for each unique y-value.  Is there a very efficient 
way to do this in Perl?




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

Date: Thu, 09 Dec 2004 14:29:06 +0800
From: sam <sam.wun@authtec.net>
Subject: Perl to MySQL?
Message-Id: <cp8ssj$1pe8$2@news.hgc.com.hk>

Hi,

Can anyone tell me how to write Perl script connect to MySQL database?

Thanks
Sam


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

Date: Thu, 09 Dec 2004 14:56:12 +0800
From: sam <sam.wun@authtec.net>
Subject: Re: Perl to MySQL?
Message-Id: <cp8ufe$1q7m$1@news.hgc.com.hk>

sam wrote:

> Hi,
> 
> Can anyone tell me how to write Perl script connect to MySQL database?
> 
I noticed that webmin doesn't use DBD/DBI module manage mysql databases.
Which method is better, use the native perl code or DBD/DBI modules?

Sam.

> Thanks
> Sam


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

Date: Thu, 09 Dec 2004 18:50:54 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Perl to MySQL?
Message-Id: <31qhvjF3ee180U1@individual.net>

sam wrote:

> sam wrote:
> 
>> Hi,
>> 
>> Can anyone tell me how to write Perl script connect to MySQL database?
>> 
> I noticed that webmin doesn't use DBD/DBI module manage mysql databases.
> Which method is better, use the native perl code or DBD/DBI modules?
> 
> Sam.
> 
>> Thanks
>> Sam

Webmin has its own web server, and only assumes a minimal Perl 5
installation.

Use the mysql DBI for general Perl/mysql programming.

gtoomey


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

Date: Thu, 09 Dec 2004 03:57:07 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl to MySQL?
Message-Id: <8uudnYqLNNj5jiXcRVn-ow@adelphia.com>

sam wrote:

> Can anyone tell me how to write Perl script connect to MySQL database?

How on earth did you manage to miss the dozens of books, web sites, 
articles and other stuff that's been written on the subject?

Go to <http://dbi.perl.org>. Read stuff.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 09 Dec 2004 03:58:02 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl to MySQL?
Message-Id: <8uudnYWLNNgHjiXcRVn-ow@adelphia.com>

sam wrote:

> Which method is better, use the native perl code or DBD/DBI modules?

The one that *doesn't* involve reinventing the wheel, duh.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Wed, 8 Dec 2004 21:32:59 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: regular expressions problem
Message-Id: <sl4l82x934.ln2@goaway.wombat.san-francisco.ca.us>

On 2004-12-09, Shailesh Humbad <humbads1@hotmail.com> wrote:
> I want to parse the values from the second-to-last row in an html
> table.

Have you looked at the various HTML parsers available on CPAN?  Doing
this with a regex is bound to cause problems.  (I'm partial to
HTML::TreeBuilder, myself, but I'm sure that others can make additional
suggestions.)

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom



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

Date: 8 Dec 2004 22:49:20 -0800
From: "Shailesh Humbad" <humbads1@hotmail.com>
Subject: Re: regular expressions problem
Message-Id: <1102574960.636719.200700@c13g2000cwb.googlegroups.com>

Keith Keller wrote:
> On 2004-12-09, Shailesh Humbad <humbads1@hotmail.com> wrote:
> > I want to parse the values from the second-to-last row in an html
> > table.
>
> Have you looked at the various HTML parsers available on CPAN?  Doing
> this with a regex is bound to cause problems.  (I'm partial to
> HTML::TreeBuilder, myself, but I'm sure that others can make
additional
> suggestions.)
>
> --keith
>
> --
> kkeller-usenet@wombat.san-francisco.ca.us
> (try just my userid to email me)
> AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

Trouble is, I am using regular expressions in a VBScript file, so I
don't have any Perl support...  Even then, the page is probably not
valid HTML. I could use multiple regular expressions in steps.  At
least, is there a way to match from "<tr class=\"totals" to the
immediately previous "<tr"?  From there I could figure it out.  Maybe
I'll try searching within a reversed copy of the string.



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

Date: Thu, 09 Dec 2004 06:55:38 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: regular expressions problem
Message-Id: <KFStd.3481$mn6.2707@trnddc07>

Shailesh Humbad wrote:
> I want to parse the values from the second-to-last row in an html
> table.
>
> ...
> <tr class="odd">
> <td style="text-align: right;" nowrap="nowrap">99</td>
> <td style="text-align: right;" nowrap="nowrap">111</td>
> <td style="text-align: right;" nowrap="nowrap">52255</td>
> <td style="text-align: right;" nowrap="nowrap">333</td>
> <td style="text-align: right;" nowrap="nowrap">2323</td>
> </tr>
> <tr class="totals">

As has been mentioned here _very_ frequently parsing HTML correctly using 
REs is insane. It hasn't even been proven if the extended REs in Perl would 
be powerful enough to do it (normal REs are definitely not sufficient!), let 
alone finding a usable RE to do it.

Use an HTML parser to parse HTML. There are several on CPAN.
And please read the FAQ before asking frequently asked questions (perldoc -q 
"remove HTML").

jue 




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

Date: Thu, 09 Dec 2004 03:54:27 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: regular expressions problem
Message-Id: <8uudnYuLNNhejyXcRVn-ow@adelphia.com>

Shailesh Humbad wrote:

> Trouble is, I am using regular expressions in a VBScript file, so I
> don't have any Perl support...

The VBScript group is down the hall on your left. Don't let the door hit 
you on the way out.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 9 Dec 2004 10:04:26 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: regular expressions problem
Message-Id: <Xns95BA667A5990Felhber1lidotechnet@62.89.127.66>

Sherm Pendley <spamtrap@dot-app.org> wrote:

> Shailesh Humbad wrote:
> 
>> Trouble is, I am using regular expressions in a VBScript file, so
>> I don't have any Perl support...
> 
> Don't let the door hit you on the way out.


I say let it.


-- 
Cheers,
Bernard


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

Date: Wed, 8 Dec 2004 23:03:05 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: why the following HereDoc print don't work?
Message-Id: <slrncrfn49.7o3.tadmc@magna.augustmail.com>

ÕÔ±û·å <zhao_bingfeng@topsec.com.cn> wrote:

> Perl complained "Can't find string terminator "EOF" anywhere before EOF at
> XXX(line No.)".
> What happened and why?


You can most often answer questions about messages from perl if
you read up on the message in perldiag.pod.

Or, put

   use diagnostics;

at the top of your program and run it again, then perl will lookup
and display the description from perldiag for you.


   =item Can't find string terminator %s anywhere before EOF
   
   (F) Perl strings can stretch over multiple lines.  This message means
   that the closing delimiter was omitted.  Because bracketed quotes count
   nesting levels, the following is missing its final parenthesis:
   
       print q(The character '(' starts a side comment.);
   
   If you're getting this error from a here-document, you may have included
   unseen whitespace before or after your closing tag. A good programmer's
   editor will have a way to help you find these characters.
   

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


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

Date: Thu, 09 Dec 2004 03:49:09 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: why the following HereDoc print don't work?
Message-Id: <t4qdndRySqsYjCXcRVn-hw@adelphia.com>

A. Sinan Unur wrote:

> "bingfeng" <zhao_bingfeng@topsec.com.cn> wrote in
> news:cp8arq$2649$1@mail.cn99.com: 
> 
> 
>>The following codes does not work still:
>>
>><CODE>
>>use strict;
>>use warnings;
>>
>>print <<EOF;
>>Help text:
>>Command line is:
>>Datecheck [options] <files> [<files>...]
>>where:
>>     [Option] are to be defined
>>EOF
>></CODE>
> 
> 
> Funny ... odd ... curious ...

 ... and correct. I copy everything up to and including the EOF - but 
*NOT* the newline after EOF - into a text file and run it. What do I see?

Sherm-Pendleys-Computer:~ sherm$ perl test.pl
Can't find string terminator "EOF" anywhere before EOF at test.pl line 6.

Now I add a newline to the end, after EOF, and what do I see?

Sherm-Pendleys-Computer:~ sherm$ perl test.pl
Help text:
Command line is:
Datecheck [options] <files> [<files>...]
where:
      [Option] are to be defined

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 09 Dec 2004 03:52:19 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: why the following HereDoc print don't work?
Message-Id: <8uudnYiLNNjZjyXcRVn-ow@adelphia.com>

Tad McClellan wrote:

> You can most often answer questions about messages from perl if
> you read up on the message in perldiag.pod.

Excellent advice for the general case, but in this case specifically it 
looks to me like perldiag is missing a critical bit of info that might 
have been helpful:

>    If you're getting this error from a here-document, you may have included
>    unseen whitespace before or after your closing tag.

 ... or, the closing tag might be at the end of the file, on a line that 
doesn't end with a newline character.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7499
***************************************


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