[27950] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9314 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 19 14:05:57 2006

Date: Mon, 19 Jun 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           Mon, 19 Jun 2006     Volume: 10 Number: 9314

Today's topics:
        call an external c++ program Deb.Fang@gmail.com
    Re: call an external c++ program <David.Squire@no.spam.from.here.au>
    Re: call an external c++ program <josef.moellers@fujitsu-siemens.com>
    Re: call an external c++ program <jurgenex@hotmail.com>
    Re: call an external c++ program <Deb.Fang@gmail.com>
    Re: call an external c++ program <jurgenex@hotmail.com>
    Re: call an external c++ program <Deb.Fang@gmail.com>
    Re: call an external c++ program <Deb.Fang@gmail.com>
    Re: Evaluating environment variables prattm@gmail.com
        How to generate events in Siemens Server View <hara.acharya@gmail.com>
        How to pass a control-6 in Net::Telnet pablo.barbachano@gmail.com
        installing Crypt::DES on ActiveState <Amaninder.Saini@gmail.com>
    Re: noob asks: differences Activestate 5.8.x vs 5.6.x.  <jl_post@hotmail.com>
    Re: Outlook Crapolla: The Fakie Breakie <afrinspray@gmail.com>
    Re: Outlook Crapolla: The Fakie Breakie <afrinspray@gmail.com>
    Re: Printing hash in table format <pradeep.bg@gmail.com>
    Re: question on printing to /dev/lp <benmorrow@tiscali.co.uk>
        Reading from pipe with perl -na -e and detecting last l <bew_ba@gmx.net>
    Re: Reading from pipe with perl -na -e and detecting la jgraber@ti.com
    Re: Reading from pipe with perl -na -e and detecting la xhoster@gmail.com
    Re: Reading from pipe with perl -na -e and detecting la xhoster@gmail.com
    Re: Reading from pipe with perl -na -e and detecting la <mumia.w.18.spam+nospam.usenet@earthlink.net>
    Re: Reading from pipe with perl -na -e and detecting la <benmorrow@tiscali.co.uk>
    Re: Tk bug not fixed in CPAN <zentara@highstream.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Jun 2006 05:56:39 -0700
From: Deb.Fang@gmail.com
Subject: call an external c++ program
Message-Id: <1150721799.409917.140280@g10g2000cwb.googlegroups.com>

I am having the hardest time finding information on the web so maybe
someone could help. I have a perl CGI script accepting data from a
form, this part is easy.  But then, depending on the data from the
form I need to call a C++ program and pass the data I just received to
this c++ program.  Then my C++ program will output results to a txt
file. Then I use XML to get the output file formatted.
now, I am stuck in the step how to call the c++ program and pass the
data to the c++ program.

I've found a lot of different references, but none have helped. If you
have any input it would be appreciated.



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

Date: Mon, 19 Jun 2006 14:25:59 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: call an external c++ program
Message-Id: <e768l7$47k$1@news.ox.ac.uk>

Deb.Fang@gmail.com wrote:
> I am having the hardest time finding information on the web so maybe
> someone could help. I have a perl CGI script accepting data from a
> form, this part is easy.  But then, depending on the data from the
> form I need to call a C++ program and pass the data I just received to
> this c++ program.  Then my C++ program will output results to a txt
> file. Then I use XML to get the output file formatted.
> now, I am stuck in the step how to call the c++ program and pass the
> data to the c++ program.
> 
> I've found a lot of different references, but none have helped. If you
> have any input it would be appreciated.
> 

First question: why do you need Perl at all? Why not write your CGI 
program in C++?

DS


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

Date: Mon, 19 Jun 2006 15:36:52 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: call an external c++ program
Message-Id: <e769hr$l7a$1@nntp.fujitsu-siemens.com>

David Squire wrote:

> First question: why do you need Perl at all? Why not write your CGI=20
> program in C++?

You do know that people get hung by their %s, $s, @s and &s for making=20
such a remark?

Josef, who could not resist
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Mon, 19 Jun 2006 14:07:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: call an external c++ program
Message-Id: <ncylg.9710$DR1.4287@trnddc02>

Deb.Fang@gmail.com wrote:
> I am having the hardest time finding information on the web so maybe
> someone could help. I have a perl CGI script accepting data from a
> form, this part is easy.  But then, depending on the data from the
> form I need to call a C++ program

perldoc -f system

> and pass the data I just received to
> this c++ program.

Dozens of different methods, depending on how you want to do it. Perl pretty 
much supports all the standard interprocess communication methods from 
signals and parameters to pipes, sockets, and and and. You name it, Perl got 
it.

jue 




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

Date: 19 Jun 2006 07:30:02 -0700
From: "debbie523" <Deb.Fang@gmail.com>
Subject: Re: call an external c++ program
Message-Id: <1150727402.328649.291780@g10g2000cwb.googlegroups.com>

 I am a new hand in this area, could u give me more details?
Thanks a lot... !!!!



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

Date: Mon, 19 Jun 2006 14:46:26 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: call an external c++ program
Message-Id: <6Nylg.2534$DI2.85@trnddc05>

debbie523 wrote:
> I am a new hand in this area,

Which area? Please quote context such that people know what you are talking 
about.

> could u

Who is u?

> give me more details?

More details about what? Please quote appropriate context -as has been 
customary on Usenet for 2 decades- such that people have a chance to know 
what you are talking about.

If you are Google challanged (shamelessly copied from someone else):

For [...] and everybody else with "User-Agent: G2/#.#":

"How can I automatically quote the previous message
when I post a reply?"
http://groups.google.co.uk/support/bin/answer.py?answer=14213

See also:
http://www.safalra.com/special/googlegroupsreply/


What's good 'netiquette' when posting to Usenet?
http://groups.google.co.uk/support/bin/answer.py?answer=12348
http://directory.google.com/Top/Computers/Usenet/Etiquette/

But Google needs you to vote for 'Default quoting of
previous message in replies'
http://groups-beta.google.com/support/bin/request.py?contact_type=features

jue 




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

Date: 19 Jun 2006 08:22:55 -0700
From: "debbie523" <Deb.Fang@gmail.com>
Subject: Re: call an external c++ program
Message-Id: <1150730572.875572.232410@y41g2000cwy.googlegroups.com>


J=FCrgen Exner wrote:
> debbie523 wrote:
> > I am a new hand in this area,
>
> Which area?
> use perl cgi to build up an interface.


>Please quote context such that people know what you are talking
> about.
>
> > could u
>
> Who is u?
> u is u

> > give me more details?
>more details about how to pass the received data as parameters and call a =
program which located in my another folder in a perl cgi script .

> More details about what? Please quote appropriate context -as has been
> customary on Usenet for 2 decades- such that people have a chance to know
> what you are talking about.
>
> If you are Google challanged (shamelessly copied from someone else):
>
> For [...] and everybody else with "User-Agent: G2/#.#":
>
> "How can I automatically quote the previous message
> when I post a reply?"
> http://groups.google.co.uk/support/bin/answer.py?answer=3D14213
>
> See also:
> http://www.safalra.com/special/googlegroupsreply/
>
>
> What's good 'netiquette' when posting to Usenet?
> http://groups.google.co.uk/support/bin/answer.py?answer=3D12348
> http://directory.google.com/Top/Computers/Usenet/Etiquette/
>
> But Google needs you to vote for 'Default quoting of
> previous message in replies'
> http://groups-beta.google.com/support/bin/request.py?contact_type=3Dfeatu=
res
>=20
> jue

Thanks, jue. You gave me good suggestions.



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

Date: 19 Jun 2006 08:23:39 -0700
From: "debbie523" <Deb.Fang@gmail.com>
Subject: Re: call an external c++ program
Message-Id: <1150730619.310565.235810@f6g2000cwb.googlegroups.com>


J=FCrgen Exner wrote:
> debbie523 wrote:
> > I am a new hand in this area,
>
> Which area?
> use perl cgi to build up an interface.


>Please quote context such that people know what you are talking
> about.
>
> > could u
>
> Who is u?
> u is jue.
> > give me more details?
>more details about how to pass the received data as parameters and call a =
program which located in my another folder in a perl cgi script .

> More details about what? Please quote appropriate context -as has been
> customary on Usenet for 2 decades- such that people have a chance to know
> what you are talking about.
>
> If you are Google challanged (shamelessly copied from someone else):
>
> For [...] and everybody else with "User-Agent: G2/#.#":
>
> "How can I automatically quote the previous message
> when I post a reply?"
> http://groups.google.co.uk/support/bin/answer.py?answer=3D14213
>
> See also:
> http://www.safalra.com/special/googlegroupsreply/
>
>
> What's good 'netiquette' when posting to Usenet?
> http://groups.google.co.uk/support/bin/answer.py?answer=3D12348
> http://directory.google.com/Top/Computers/Usenet/Etiquette/
>
> But Google needs you to vote for 'Default quoting of
> previous message in replies'
> http://groups-beta.google.com/support/bin/request.py?contact_type=3Dfeatu=
res
>=20
> jue

Thanks, jue. You gave me good suggestions.



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

Date: 19 Jun 2006 08:07:16 -0700
From: prattm@gmail.com
Subject: Re: Evaluating environment variables
Message-Id: <1150729636.137563.25070@h76g2000cwa.googlegroups.com>

Thanks for the replies.  Glenn's suggestion did work as is, although I
have yet to try it without the /e modifier.

Mike


Uri Guttman wrote:
> >>>>> "GJ" == Glenn Jackman <glennj@ncf.ca> writes:
>
>   GJ> At 2006-06-14 05:49PM, prattm@gmail.com <prattm@gmail.com> wrote:
>   >> I am reading in a config file that has a bunch of absolute file paths,
>   >> most with embedded environment variables, such as:
>   >>
>   >> ${HOME}/bin/myscript.pl
>
>   GJ> Assuming you have braces around all your variable names:
>
>   GJ>     s/\${(.*?)}/$ENV{$1}/eg
>
> you don't need /e as the replacement there is a valid string and doesn't
> need to be evaled. and you will likely need to escape the { as perl will
> interpret {} as a quantifier. i haven't tested that and i leave that as
> an exercise to the OP.
>
> uri
>
> --
> Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
> --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
> Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org



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

Date: 19 Jun 2006 04:23:38 -0700
From: "king" <hara.acharya@gmail.com>
Subject: How to generate events in Siemens Server View
Message-Id: <1150716218.804260.38280@u72g2000cwu.googlegroups.com>

In the Siemens Server View testing I want to test the monitoring tool.
So i want to create some events or errors on the Hard disk logical
partition by writing a perl script.

So can any-body help me with a script which can generate error or
events on the Hard disk,
Fan Voltage, CPU  etc.
Especially on the RAM and hard disk i want to generate errors.

I didn't even get the idea how to start with.

Can any body help.



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

Date: 19 Jun 2006 08:21:59 -0700
From: pablo.barbachano@gmail.com
Subject: How to pass a control-6 in Net::Telnet
Message-Id: <1150730519.749373.284250@r2g2000cwb.googlegroups.com>

Hi, I'm just developing a small script that communicates with a small
piece of hw. The hw switches between modes when you press Control-6.
How can I send that from Net::Telnet? I suppose that the ->put($value)
is the most suitable since it doesn't add a "\n" at the end, but what
is the $value I have to put there? AFAIK control-6 is not one of the
ASCII escape sequences, is it?

Thanks in advance
Pablo



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

Date: 19 Jun 2006 08:24:59 -0700
From: "Amaninder" <Amaninder.Saini@gmail.com>
Subject: installing Crypt::DES on ActiveState
Message-Id: <1150730699.265670.124160@h76g2000cwa.googlegroups.com>

Hi everyone

I want to install Crypt::DES module for my Net::SNMP::Security::USM. I
am  using ActiveState Komodo version 3.5. I tried the following things.

I typed :
"ppm install Crypt::DES" in run command.
I got this error:
Installing package 'Crypt-DES'...
Error installing package 'Crypt-DES': Could not locate a PPD file for
package Crypt-DES

Then i google and find some information on
http://www.pavleck.com/2006/04/21/activestate-activeperl-ppm-error-error-ppd-for-crypt-desppd-could-not-be-found/

I tried to add new repository:
rep add Canada
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
I got error again:
'rep' is not recognized as an internal or external command,
operable program or batch file.

Then i find this page
http://72.14.207.104/search?q=cache:exjP-i84bwkJ:www.atlcon.net/opensrs/nt-howto-v2.2.htm+opensrs+crypt+des&hl=en&ct=clnk&cd=7

I tried :
set repository ActivePerl http://www.activestate.com/PPMPackages/5.005/
Still dont work

Then i downloaded Crypt-DES-2.05.tar.gz from cpan. untar it and run
perl Makefile.pl. Now, i cant run "make" because i am using windows.

        1. perl Makefile.PL
        2. make
        3. make test
        4. make install

I tried but could not able to install Crypt::DES on ActiveState. If
anyone knows how to do this please let me know. Thanks in advance.

Regards
Amaninder Saini



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

Date: 19 Jun 2006 08:24:42 -0700
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: noob asks: differences Activestate 5.8.x vs 5.6.x. pros vs cons of each?
Message-Id: <1150730681.947744.242210@y41g2000cwy.googlegroups.com>

noob@public.com wrote:
> For a Windows ME system, is there a reason not to use v5.8.8 and use
> 5.6.1 instead? Also for Win9x or WinXP.

   I would always recommend the latest and greatest, unless the're a
very good reason not to use it.

   So far, the only advantage I've found to using the 5.6.1 version is
that some modules are available in ActiveState's 5.6 ppm that are not
available yet in the 5.8 ppm repository.

   However, this is fairly rare, and the more time passes, the more the
5.8 repositories will get updated, making such an issue less and less
likely.  (And presumably making the opposite scenario (where a module
is available in 5.8 but not in 5.6) more likely.)

   So if it's between 5.6.1 and 5.8.8, my advice is to use 5.8.8.

   -- Jean-Luc



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

Date: 19 Jun 2006 08:47:44 -0700
From: "afrinspray" <afrinspray@gmail.com>
Subject: Re: Outlook Crapolla: The Fakie Breakie
Message-Id: <1150732064.646900.105770@u72g2000cwu.googlegroups.com>

Dr.Ruud wrote:
>   s~ < (SPAN) (?:\s[^>]*)? > \s*            < / \1 > ~~xg ;
>   s~ < (FONT) (?:\s[^>]*)? > \s*            < / \1 > ~~xg ;
>   s~ < (DIV)  (?:\s[^>]*)? > \s* &nbsp; \s* < / \1 > ~~xg ;

Great idea, but I'm not sure that these tags will always be in the same
order.  (i.e. <div><font><span>).  I used this HTML::TreeBuilder class
to remove empty tags, which is a solid alternative to what you wrote
above.  But I still can't remove these tags outright, just because they
might be important depending on the spacing properties of these mystery
styles.  I did some research this morning on the Microsoft CSS class,
MsoNormal, which if the newsgroups are correct, is supposed to make a
newline meaningless. So i guess the real trick it to remove all
MsoNormal tags, then do what you did above with the &nbsp; -> <br>.

Thanks!

Mike



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

Date: 19 Jun 2006 08:59:13 -0700
From: "afrinspray" <afrinspray@gmail.com>
Subject: Re: Outlook Crapolla: The Fakie Breakie
Message-Id: <1150732753.275927.122570@g10g2000cwb.googlegroups.com>

Reference to anyone viewing this article in the future...

MsoNormal from the "Save as Web Page" feature in Word 2003:

<STYLE>
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman";
mso-style-parent: ""; mso-pagination: widow-orphan;
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman";
mso-style-parent: ""; mso-pagination: widow-orphan;
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman";
mso-style-parent: ""; mso-pagination: widow-orphan;
mso-fareast-font-family: "Times New Roman"
}
</STYLE>



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

Date: 19 Jun 2006 07:22:32 -0700
From: "Deepu" <pradeep.bg@gmail.com>
Subject: Re: Printing hash in table format
Message-Id: <1150726952.193534.254320@g10g2000cwb.googlegroups.com>

Hi All,

Once i have the 1st main table as input i read the table and store it
in a hash with keys and values
"TEST1-TEST2" => 1
"TEST1-TEST3" => 0

1 for Y in the main table and 0 for N in the main table.

I also have a 2nd hash with same keys but values will be initialized to
zeros.

Then i will read the 2nd file with transitions, store it in an array
and for each element compare with the 1st hash. If the transition
exists then increment the value of 2nd hash pertaining to that key.

Once i have all the keys and values, i will print using the part of
code shown before. But now i am trying to print it in table format
instead of just printing like hash.

Thanks for the help.




Nick of course wrote:
> Deepu wrote:
> > while (($key, $value) = each %hash) {
> >   print ("%-20s => %d\n", $key, $value);
> > 
> > }
> Should be printf not print



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

Date: Mon, 19 Jun 2006 14:28:26 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: question on printing to /dev/lp
Message-Id: <qclim3-a1h.ln1@osiris.mauzo.dyndns.org>


Quoth Huub <"v.niekerk at hccnet.nl">:
> 
> I want to print my output to a printer and not to screen. In the FAQ I 
> read about filehandles. Do I open printers the same way as files or 
> differently? And how about ejecting a sheet from the printer? Is there a 
> command for it?

The usual way to print on Unix systems is to open a pipe to lpr(1) or
lp(1) (depending on which you have). Read the manual to find out what
data formats they accept: commonly, you must convert your output to
PostScript. You can do this with the program a2ps (among others); this
will convert a form-feed ("\cL") into a new page.

Ben

-- 
  Joy and Woe are woven fine,
  A Clothing for the Soul divine       William Blake
  Under every grief and pine          'Auguries of Innocence'
  Runs a joy with silken twine.                         benmorrow@tiscali.co.uk


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

Date: 19 Jun 2006 07:03:59 -0700
From: "bernd" <bew_ba@gmx.net>
Subject: Reading from pipe with perl -na -e and detecting last line
Message-Id: <1150725839.444863.139630@f6g2000cwb.googlegroups.com>

Hello netties,

I cat a file (actually grepping some particular lines) to "perl -na -e"
and have to determine when I have read the last line of the content of
the file (which is actually "filtered" by grep already, so that I
cannot give perl the whole file as a command line argument).

Does somebody know how I detect the last line piped to perl? eof()
obviously does not work.

Cheers


Bernd



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

Date: 19 Jun 2006 10:25:58 -0500
From: jgraber@ti.com
Subject: Re: Reading from pipe with perl -na -e and detecting last line
Message-Id: <yvnfyi1cgl5.fsf@famous02.dal.design.ti.com>

"bernd" <bew_ba@gmx.net> writes:

> I cat a file (actually grepping some particular lines) to "perl -na -e"
> and have to determine when I have read the last line of the content of
> the file (which is actually "filtered" by grep already, so that I
> cannot give perl the whole file as a command line argument).
> 
> Does somebody know how I detect the last line piped to perl? eof()
> obviously does not work.

You could make a one-liner file that contains an end of file text line
that will be filtered in by grep,  (untested)

echo 'grepstring ENDOFFILE' > endoffile
grep grepstring file1 file2 endoffile | \
  perl -na -e 'if (/ENDOFFILE/) { eof stuff} {non eof stuff}'

However, since perl is a better grepper than grep,
my prefered solution is to include 
the functionality of grep in the perl one-liner.
  To detect the end of each of multiple files, use  if (eof)
as listed in perldoc -f eof,  but note that the eof test
has to be the first thing in the loop.
The following one-liner (with escaped \n between lines)
was tested using the entire text 
of this post as the contents of file ex1
  Note that I did not reset the count between files inside the eof block.

perl -na -e 'if (eof) {print STDERR "** eof $ARGV has $count\n"} \
                 next unless /grepstring/; ++$count; ' ex1 ex1

** eof ex1 has 3
** eof ex1 has 6

-- 
Joel


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

Date: 19 Jun 2006 16:22:09 GMT
From: xhoster@gmail.com
Subject: Re: Reading from pipe with perl -na -e and detecting last line
Message-Id: <20060619122250.537$AC@newsreader.com>

"bernd" <bew_ba@gmx.net> wrote:
> Hello netties,
>
> I cat a file (actually grepping some particular lines) to "perl -na -e"
> and have to determine when I have read the last line of the content of
> the file (which is actually "filtered" by grep already, so that I
> cannot give perl the whole file as a command line argument).

Why not do the grep in Perl?  or just pass the stream through "last" before
going into Perl?

> Does somebody know how I detect the last line piped to perl? eof()
> obviously does not work.

That is not obvious to me.

This does what I thought it would:

cat foo.pl | perl -lne 'print eof()? "last line: $_":$_'

It prints out all of foo.pl, with "last line: " preprended to the last
line.


Xho

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


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

Date: 19 Jun 2006 16:41:02 GMT
From: xhoster@gmail.com
Subject: Re: Reading from pipe with perl -na -e and detecting last line
Message-Id: <20060619124143.841$ZX@newsreader.com>

xhoster@gmail.com wrote:
> "bernd" <bew_ba@gmx.net> wrote:
> > Hello netties,
> >
> > I cat a file (actually grepping some particular lines) to "perl -na -e"
> > and have to determine when I have read the last line of the content of
> > the file (which is actually "filtered" by grep already, so that I
> > cannot give perl the whole file as a command line argument).
>
> Why not do the grep in Perl?  or just pass the stream through "last"
> before going into Perl?

Er, "tail", not "last".

Xho

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


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

Date: Mon, 19 Jun 2006 16:51:33 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Reading from pipe with perl -na -e and detecting last line
Message-Id: <pCAlg.7976$lf4.1551@newsread1.news.pas.earthlink.net>

bernd wrote:
> [...]
> Does somebody know how I detect the last line piped to perl? eof()
> obviously does not work.
> [...]

You don't have to. Just put the code to be executed at the end of input 
inside an END block.

Try "perldoc perlrun."



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

Date: Mon, 19 Jun 2006 15:18:09 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Reading from pipe with perl -na -e and detecting last line
Message-Id: <1aoim3-vbh.ln1@osiris.mauzo.dyndns.org>


Quoth "bernd" <bew_ba@gmx.net>:
> 
> I cat a file (actually grepping some particular lines) to "perl -na -e"
> and have to determine when I have read the last line of the content of
> the file (which is actually "filtered" by grep already, so that I
> cannot give perl the whole file as a command line argument).
> 
> Does somebody know how I detect the last line piped to perl? eof()
> obviously does not work.

~% perl -le'print for qw/a b c/' | perl -na -le'print "eof" if eof; print'
a
b
eof
c

Ben

-- 
Giles: It's very common for Indian spirits to change to animal form.
Buffy: [...] and, 'Native American'. G: Sorry? B: We don't say 'Indian'.
G: Oh, right, yes; always behind on the terms... yes, still trying not to refer
to you lot as 'bloody colonials'.      [Buffy, 'Pangs'] benmorrow@tiscali.co.uk


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

Date: Mon, 19 Jun 2006 11:05:43 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Tk bug not fixed in CPAN
Message-Id: <f61d92t0jr6kiiuduaf6cvqlen0t1lmtj4@4ax.com>

On 18 Jun 2006 16:18:55 -0700, "Larry" <larry.grant.dc@gmail.com> wrote:


>> Yeah, I notice the same thing. Nick will say he has made the changes
>> to his sources to reflect the bug-fix, but it is never updated in the
>> latest download.
>>
>> Maybe you can re-post this question in comp.lang.perl.tk, where
>> Nick Ing-Simmons frequently responds.
>
>I tried that, as well as sending an email directly to Nick.   No
>response.
>
>Regardless of the bug, just the fact that a module as major as a Tk has
>not been updated on CPAN since '04 is troubling.  I would expect that
>someone here would have something to say about this.

I agree.  Maybe it's one of the reasons many are jumping to Gtk2.


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


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

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


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