[29419] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 663 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 20 00:10:09 2007

Date: Thu, 19 Jul 2007 21:09:07 -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           Thu, 19 Jul 2007     Volume: 11 Number: 663

Today's topics:
    Re: A perl issue when execute system call <spamtrap@dot-app.org>
    Re: how to distill this par of string from whole string <tadmc@seesig.invalid>
        interpolation  new2perl@gmail.com
    Re: interpolation <tadmc@seesig.invalid>
    Re: interpolation  new2perl@gmail.com
    Re: Math <sigzero@gmail.com>
    Re: Math <blb8@po.cwru.edu>
    Re: Math <sisyphus1@nomail.afraid.org>
        NET::SMTP and Authentication <wheeledBob@yahoo.com>
    Re: new lines in the way  new2perl@gmail.com
        OCI announces open source CORBA ORB in Perl  spence_m@ociweb.com
    Re: pid from startet process <ced@blv-sam-01.ca.boeing.com>
    Re: pid from startet process (Douglas Wells)
    Re: retrieving usenet messages III <zaxfuuq@invalid.net>
    Re: retrieving usenet messages III <zaxfuuq@invalid.net>
    Re: retrieving usenet messages III <zaxfuuq@invalid.net>
    Re: To know if a variable is a file handler <dummy@example.com>
    Re: Use UTF-8 in Log::StdLog? <jerry@sheepsystems.com>
    Re: Using the split function <bik.mido@tiscalinet.it>
    Re: Using the split function <abigail@abigail.be>
    Re: Using the split function (Steven M. O'Neill)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Jul 2007 16:11:01 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: A perl issue when execute system call
Message-Id: <m2644gf92i.fsf@dot-app.org>

Mirco Wahab <wahab@chemie.uni-halle.de> writes:

> jeanwelly wrote:
>> I met with a hang issue when using perl in some Unix server, don't
>> why? Could you help?
>>
>> print "start...\n";
>> my $result = `which command`;
>> print "Stop...\n"; # can not call to here.
>> chomp($result);
>
> What is "command"?

Not "what" - "which". It's a *nix command that crawls your PATH and reports
where it finds the first occurrence of "command".

If there's a network share in your PATH, and it's missing or unresponsive
for some reason, "which" may have to wait for an attempted network connection
to time out. Jean, how long have you waited?

> What happens if you put the "command"
> into a shell?
>
> $~jeanwelly> command [enter]

A valid and useful suggestion, but the OP would better off testing "which
command" instead of "command".

    $~jeanwelly> which command [enter]

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 19 Jul 2007 19:54:40 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: how to distill this par of string from whole string
Message-Id: <slrnfa01ug.uoc.tadmc@tadmc30.sbcglobal.net>

jeanwelly <jeanwelly@gmail.com> wrote:
> $mystring = "andgjdkj..dlodjghghdhhdghhd\ndkkdkd\n/usr/local/ddd\n";
                                                             ^ ^
                                                             ^ ^
> I want to distill "/usr/loca/add" 


What is it about that string that indicates that that is what
should be extracted?

Where did the missing "l" go?

What changed "ddd" to "add"?


> from the string and assign to a
> variable, thanks!


   (my $variable = $mystring) =~ s/^(.*?\/)|\n//sg;
or
   my $variable = substr $mystring, rindex($mystring, '/usr/'), -1;
or
   my $variable = substr $mystring, 35, 14;
or
   my($variable) = $mystring =~ /^(\/.*)/m;
or
   my($variable) = $mystring =~ m#(/.*)#;
or
   my($variable) = grep /\//, split /\n/, $mystring;
or
   my $variable = (split /\n/, $mystring)[2];


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 20 Jul 2007 01:13:51 -0000
From:  new2perl@gmail.com
Subject: interpolation
Message-Id: <1184894031.992650.272370@e16g2000pri.googlegroups.com>

Assigning a variable.
Then reading in text file that uses the variable.
It's isn't resolved.

Input file:
Your name is: $name

Script:
#!/bin/perl

$name="Rupert";
$text="textin";

open (MYFILE,  $text) or die "cant open erik";

while (<MYFILE>) { $value = $_ }

print "$value";


Output:
Your name is: $name


Output that I want:
Your name is Rupert.


What am I doing wrong here ?

Bob



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

Date: Fri, 20 Jul 2007 02:32:50 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: interpolation
Message-Id: <slrnfa06si.46g.tadmc@tadmc30.sbcglobal.net>

new2perl@gmail.com <new2perl@gmail.com> wrote:
> Assigning a variable.
> Then reading in text file that uses the variable.
> It's isn't resolved.


Of course not. Data is not the same thing as Code.


> Input file:
> Your name is: $name
>
> Script:
> #!/bin/perl

   use strict;
   use warnings;


> $name="Rupert";

   my $name="Rupert";


> $text="textin";
>
> open (MYFILE,  $text) or die "cant open erik";


You did not try to open "erik", you tried to open "textin".


> while (<MYFILE>) { $value = $_ }


That reads all the lines, and discards all of them except the last line.


> print "$value";


   print $value;

      perldoc -q vars

       What’s wrong with always quoting "$vars"?


> Output:
> Your name is: $name
>
>
> Output that I want:
> Your name is Rupert.
>
>
> What am I doing wrong here ?


Conflating what is "data" with what is "code".


Your Question is Asked Frequently:

   perldoc -q expand

       How can I expand variables in text strings?


However, I'm quite sure that you are asking the wrong question.

You should instead be asking about Templating systems.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 20 Jul 2007 03:44:30 -0000
From:  new2perl@gmail.com
Subject: Re: interpolation
Message-Id: <1184903070.997936.274550@e9g2000prf.googlegroups.com>

On Jul 19, 7:32 pm, Tad McClellan <ta...@seesig.invalid> wrote:
> new2p...@gmail.com <new2p...@gmail.com> wrote:
> > Assigning a variable.
> > Then reading in text file that uses the variable.
> > It's isn't resolved.
>
> Of course not. Data is not the same thing as Code.
>
> > Input file:
> > Your name is: $name
>
> > Script:
> > #!/bin/perl
>
>    use strict;
>    use warnings;
>
> > $name="Rupert";
>
>    my $name="Rupert";
>
> > $text="textin";
>
> > open (MYFILE,  $text) or die "cant open erik";
>
> You did not try to open "erik", you tried to open "textin".
>
> > while (<MYFILE>) { $value = $_ }
>
> That reads all the lines, and discards all of them except the last line.
>
> > print "$value";
>
>    print $value;
>
>       perldoc -q vars
>
>        What's wrong with always quoting "$vars"?
>
> > Output:
> > Your name is: $name
>
> > Output that I want:
> > Your name is Rupert.
>
> > What am I doing wrong here ?
>
> Conflating what is "data" with what is "code".
>
> Your Question is Asked Frequently:
>
>    perldoc -q expand
>
>        How can I expand variables in text strings?
>
> However, I'm quite sure that you are asking the wrong question.
>
> You should instead be asking about Templating systems.
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

this should do it:
$value =~ s/\$(\w+)/${$1}/g;



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

Date: Thu, 19 Jul 2007 18:55:58 -0000
From:  Robert Hicks <sigzero@gmail.com>
Subject: Re: Math
Message-Id: <1184871358.378509.303350@n2g2000hse.googlegroups.com>

Thank you and thanks for all the answers.

Robert



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

Date: Fri, 20 Jul 2007 03:46:47 +0000 (UTC)
From: Brian Blackmore <blb8@po.cwru.edu>
Subject: Re: Math
Message-Id: <f7pb76$nie$1@gnus01.u.washington.edu>

Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Thu, 19 Jul 2007 01:46:54 -0000, Robert Hicks <sigzero@gmail.com>
> wrote:

> >Subject: Math

> Maths!

Math!  If you need an `s' at the end, it's mathematics!

> >I realize that any math in Perl is probably slower than the same math
> >in "C" but I was wondering if Perl was as accurate as "C" in math
> >computations. I don't see why it wouldn't be but I thought I would ask
> >as a heavy spherical math project is on the horizon.

> With the usual caveat about "many parameters to take into account",
> there shouldn't be a difference, but possibly for a Perl's dwimmery
> not really doing what you want. And when accuracy becomes a relevant
> issue, then you can use specialized packages, as hinted to by others.

Yeah, everyone has pretty much indicated the problems here, but I'll
echo the "it depends on what you're doing".  I'm not the expert, but I
have my own arbitrary precision stuff in perl and it's slow, but
that's okay because it is supposed to be slow (figure that one out).
On the other hand, my C matrix routines are faster than PARI.

In my experience, perl is generally slower for heavy number crunching,
but it does well enough if only 25% of your code really has anything
to do with a bunch of numerical processing.  If all that processing is
driving some other frontend, then it seems to fair pretty well.

-- 
Brian Blackmore
blb8 at po dot cwru dot edu


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

Date: Fri, 20 Jul 2007 13:48:38 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Math
Message-Id: <46a03093$0$25982$afc38c87@news.optusnet.com.au>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:u56v935haov3427m6qgcf5invob1qmmulq@4ax.com...
> On Fri, 20 Jul 2007 01:33:52 +1000, "Sisyphus"
> <sisyphus1@nomail.afraid.org> wrote:
>
>>But now things *do* start to get noticeably slower ... to the extent that 
>>a
>>"heavy spherical math project" may be better advised to use (instead of
>>Math::BigFloat) Math::Pari or <plug> Math::MPFR </plug>, both of which 
>>make
>>extensive use of "C" computations.
>
> I was about to tell you that M::BF can use a suitable XS module, if
> you tell it so: but I checked and it's not the case, although it
> definitely is with M::BI. Too bad...
>

According to my Math::BigFloat (version 1.51) documentation you can, for 
example:

use Math::BigFloat lib => 'GMP';

and that will, as I understand it, use the GMP integer routines instead of 
the (pure perl) M::BI integer routines - so long as Math::BigInt::GMP has 
been installed.

I gather that the "BigFloat" calculations are simply "BigInt" calculations, 
and that M::BF merely keeps track of where to put the decimal point, 
accuracy, precision, etc .... but I haven't looked into it beyond briefly 
skimming the M::BF documentation.

Cheers,
Rob 



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

Date: Thu, 19 Jul 2007 23:06:01 GMT
From: still me <wheeledBob@yahoo.com>
Subject: NET::SMTP and Authentication
Message-Id: <hapv93db73d0ee68fi23iogtra6tgmrcr4@4ax.com>

I need some basic info on how to go about doing authentication when
trying to connect to a server using Net::SMTP. I did some searching
but I'm not sure if I hopped on the right train. Feel free to dope
slap me with a better approach... I'm a newbie at Perl and it's object
oriented features.

My program right now does this:

	my $smtp = Net::SMTP->new(smtp.example.com');
     	die "Could not open connection: $!" if (! defined $smtp);

I found some documentation that leads me to believe I can use the code
below, but I'd like some confirmation: 

my $smtp =
Net::SMTP->new('smtp.example.com',25,'domainOfAccount.com','MyAccount','MyPassword',
:plain);

First question: Does the above modification look legit?

I also found that the are three login schemes (last parameter) of
:plain,:login, and  :cram_md5.  I read some docs on this too... most a
bit obtuse and targeted towards people working the SMTP servers... but
if I understand correctly, this controls how the user/pass is sent to
the SMTP server with "cram_md5" being encrypted, "plain" being clear
text, and "login" is ? 


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

Date: Fri, 20 Jul 2007 00:24:47 -0000
From:  new2perl@gmail.com
Subject: Re: new lines in the way
Message-Id: <1184891087.805343.140970@x35g2000prf.googlegroups.com>

On Jul 19, 7:30 am, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On Thu, 19 Jul 2007 02:11:27 -0000, new2p...@gmail.com wrote:
> ># It only prints out the first line of each joke.  I played around
> >with $/ but not working.
> ># I understand that $/ is set to new line by default. So this explains
> >why I only get
> ># the first line of each joke.
> ># There must be a simple way to fix this?  I appreciate any feedback.
> >Bob
>
> If you know $/, that is you've read
>
>   perldoc perlvar
>
> then you should know that what you'ere after is ''.
>
> Michele
> --
> {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
> (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
> 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


Thanks everyone.  I got it working.  Thanks for your great advice.
Bob



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

Date: Thu, 19 Jul 2007 12:58:04 -0700
From:  spence_m@ociweb.com
Subject: OCI announces open source CORBA ORB in Perl
Message-Id: <1184875084.616988.112520@o61g2000hsh.googlegroups.com>

Hi everyone,

 for those of you who have been looking for a way to combine the Perl
scripting language with an object model, we have opalORB.


It is from the folks who brought you commercially supported TAO ( a C+
+ ORB),
JacORB (a Java ORB), OpenDDS (real-time Pub Sub middleware) and MPC
(Perl based multipltatform/IDE build tool).


It is free, very solid and ready for production use. For more
information please go here:


http://www.ociweb.com/products/opalorb


regards Malcolm Spence
Director of Business Development
OCI St. Louis MO USA
TEL: 1-314-579-0066 ext 206
FAX: 1-314-579-0065


www.ociweb.com    www.theaceorb.com



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

Date: Thu, 19 Jul 2007 14:33:29 -0700
From:  "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: pid from startet process
Message-Id: <1184880809.798518.278830@n60g2000hse.googlegroups.com>

On Jul 19, 5:51 am, carlo.ma...@netcologne.de wrote:
> ...
> What kind of reasons can be imagined, that the method "$pid=open(H, "$
> {cmd} |");" doesn't supply the correct pid?
> Does anybody know about a method that gives me the correct pid?
>

If 'myexecutable' starts another script as
suggested and you're able to tinker with
myexecutable, launching the secondary script
via 'exec' will preserve the $pid.

hth,
--
Charles DeRykus






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

Date: Thu, 19 Jul 2007 18:28:28 -0400 (EDT)
From: see@signature.invalid (Douglas Wells)
Subject: Re: pid from startet process
Message-Id: <f7ooic$nth$1@flame.contek.com>

In article <20070719123834.995$wB@newsreader.com>,
  xhoster@gmail.com writes:
> carlo.maier@netcologne.de wrote:
> > i am starting an exectuable on hp-ux (ActivePerl Build 817) from a
> > perl script and need to know the childs pid.
> >
> > my $cmd="myexecutable -P parmfile "
> >
> > my $pid=open(H, "${cmd} |");
> > print "\ttest: $_" while (<H>);
> > close(H);
> >
> > The executable starts, but the pid i am getting is not right.
> 
> I don't see that problem.
>
> $ perl -le 'print open my $fh, q{perl -le  "print \$$;" |}; print <$fh>'
> 11050
> 11050

You don't see the problem because you're not doing the same thing
as the original poster.

The original poster's basic problem is that this form of open
(using '|') almost certainly invokes the system shell in order to
execute the command.  That shell then creates a new process to
execute the command named in the $cmd parameter.  The Perl open
function returns the PID of the shell, but the child (and the
relevant program) will have a different PID.

(And in response to another comment in this thread, the PID of
child will almost certainly not be the shell's PID plus 1.  Any
system that does that presents a major security risk and should
be trashed immediately -- because PIDs would then be guessable.)

What you have done is to present to the shell a command (print)
that it can execute internally.  Thus, it does not need to create
a child to execute the command.  Even if that weren't the case,
you have used a construct ($$) that gets expanded at the shell
level before the subprocess is invoked.  (Note you have actually
quoted that construct in several ways, but you have only protected
it against expansion in the shell that invoked perl and within
perl itself.  To protect it against the shell that is created by
the open function would require several more backslashes and lots
of experimentation.)

> Maybe your $cmd isn't doing what you think it is doing.
> 
> Also, you might want to try using the 3-or-more argument form
> of open:
> 
> open my $fh, "-|", "$cmd1", @cmd_args;

That will exhibit the same problem.

> Xho

To the OP:  What you are trying to do is rather difficult and can
be system-dependent.  There are several approaches that are often
used:

    - Many subsystems avoid this situation by allowing you to specify
      the name of the logfile as a parameter, either in the command
      line or in the parameter file.

    - You might be able to avoid the creation of the shell by using
      the perl fork and exec built-in functions.  This will require
      knowledge about the underlying POSIX functions.

    - You might perform some shell trickery whereby the newly
      created shell would create the child asynchronously, store the
      PID someplace that you could read it (e.g., in a file or as
      the first returned line in the output).  That would require
      a command something like "($cmd & echo PID=$$ ; wait) |" -- but
      that would require a higher comfort level with shell programming.
      (And don't forget about the need for quoting within Perl.)

   - This is a fairly common problem.  Someone may have actually
     written a package for this, but I am not familiar with any
     (having normally avoided the problem via the above solutions).
     It would probably be profitable for you to do some searching.

Good luck,

 - dmw

-- 
 .   Douglas Wells             .  Connection Technologies      .
 .   Internet:  -sp9804- -at - contek.com-                     .


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

Date: Thu, 19 Jul 2007 20:55:59 -0700
From: "merl the perl" <zaxfuuq@invalid.net>
Subject: Re: retrieving usenet messages III
Message-Id: <3IudnSwoAtSylT3bnZ2dnUVZ_qSonZ2d@comcast.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:ifsu93tb0b4imeg9r2n29di1nulbrhgmf2@4ax.com...
> On Wed, 18 Jul 2007 20:01:47 -0700, "Wade Ward" <zaxfuuq@invalid.net>
> wrote:
>
>>From: "Wade Ward" <zaxfuuq@invalid.net>
>
> Just a question out of curiosity: but are you and Merl the Perl the
> same person? I was quite sure about that, and thought that you
> abandoned your initial nick for the current one, and here it is: "Wade
> Ward" popping up again!
"Wade Ward" is the nom du net of my primary identity.  It helps me keep 
syntaxes apart if I come at it as a "different person."  That the two got 
intermixed is due to itunes murdering my primary identity, that being the 
one with my sense of humor regarding software that stomps on windows. 
Merrill is my given name.  Many Americans cannot so much as pronounce my 
first name.  As often as not, they call me merl.

>  perldoc perlfunc
>
> lists -X as the first.
I'll look at this presently.
-- 
Wade Ward 




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

Date: Thu, 19 Jul 2007 21:35:08 -0700
From: "merl the perl" <zaxfuuq@invalid.net>
Subject: Re: retrieving usenet messages III
Message-Id: <9cadnd0yZ6vGjD3bnZ2dnUVZ_jydnZ2d@comcast.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:fmou93phvkmge4ithbv29pql2cl8as3mar@4ax.com...
> On Wed, 18 Jul 2007 00:47:46 -0700, "merl the perl"
> <zaxfuuq@invalid.net> wrote:
>
>>my $nntp = Net::NNTP->new('newsgroups.comcast.net', ( Debug => 1) );
>
> BTW: those additional parens are unnecessary, and confusing.
>
>>This gives the following debug info:
> [snip]
>>Net::NNTP=GLOB(0x18329d0)<<< 502 NEWNEWS permission denied (command
>>disabled)
>
> Gunnar wrote:
>
> : That's the info you are supposed to study when debugging. From that it's
> : clear that the script didn't attempt to authenticate.
>
> And QoS also wrote:
>
> : It would be best if you carefully parsed anything that the server sends
> : back to your client, if you study the Net::NNTP debug information, you
> : will notice that the messages coming from the server are denoted with
> : a '<<< '.
>
> Why don't you try to put in practice their advice? That is, why don't
> *you* read the debugging info rather than having *us* read it for you?
> I think it's clear enough that the server doesn't support the NEWNEWS
> command. Or is it that hard to understand? So, to put it simply, you
> can't use *that* script. Neither could I thus I rolled my own which
> manually parses headers to achieve the same task as the original one,
> and I posted it *here*. Did you try it? Also, QoS repeatedly pointed
> you to the XOVER command instead: did you mind reading his/her
> posts?!? Yet another poster posted the link to a complete script
> following a logic similar to mine and actually using Net::NNTP's
> xover() method: did you look at it too?
No!  I haven't gotten that far.  One reason I can't get that far is that I 
have yet to get a perl program beyond hello world to compile, interpret, or 
do anything besides take a dump.

> (I made a further little modification from the last posted version, I
> think.)
#perl exe's opinion followed by source script
Can't locate Date/Parse.pm in @INC (@INC contains: C:/Perl/lib 
C:/Perl/site/lib .) at perl3.pl line 6.
BEGIN failed--compilation aborted at perl3.pl line 6.
 #!/usr/bin/perl

  use strict;
  use warnings;
  use Net::NNTP;
  use Date::Parse;

  my $nsrv='newsgroups.comcast.net';
  my $grp='comp.lang.perl.misc';
my $USER = '';
my $PASS = '';

  my $nntp=Net::NNTP->new($nsrv) or die "Can't login to `$nsrv'$!\n";
$nntp->authinfo($USER,$PASS) or die $!;
  my (undef, $first, $last, undef)=$nntp->group($grp)
    or die "Can't access $grp\n";

  my ($since, @arts)=time-24*60*60;
  for (reverse $first..$last) {
      my %hdr=map /^(\S[^:]+):\s(.*)$/g, @{$nntp->head($_)};
      defined(my $date=$hdr{'NNTP-Posting-Date'}) or next;
      defined(my $time=str2time $date)
        or warn "Couldn't parse date for article $_ ($date)\n"
        and next;
      last if $time < $since;
      unshift @arts, $_;
  }

  $nntp->article($_,\*STDOUT) for @arts;

  __END__
-- 
merl the perl





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

Date: Thu, 19 Jul 2007 22:28:46 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: retrieving usenet messages III
Message-Id: <wN-dnTD9yp5wgD3bnZ2dnUVZ_vumnZ2d@comcast.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:7dru935fq5r515772s2v83aih2si4f6dpo@4ax.com...
> On Thu, 19 Jul 2007 00:28:32 -0700, "merl the perl"
> <zaxfuuq@invalid.net> wrote:
>
>>I don't see debug information at the cpan site:
>>http://search.cpan.org/dist/libnet/Net/NNTP.pm
>
> Well, for one thing if the module is installed, you can read the
> documentation more comfortably by issuing the
>
>  perldoc Net::NNTP
>
> command at the prompt of your shell. Seeing it... one can see that
> what you say is fair enough. However the docs say clearly that
> Net::NNTP @ISA Net::Cmd, thus I would check the latter as well...
> Hmmm... it doesn't specify the Debug info "format" either... but,
> C'mon! Do you really find it that hard to understand?
>
>
> Michele
Yes, Michele.
-- 
WW 




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

Date: Thu, 19 Jul 2007 20:35:54 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: To know if a variable is a file handler
Message-Id: <KWPni.57956$xk5.52087@edtnps82>

Luis Angel Fdez. Fdez. wrote:
> 
>   I was looking in Google and I don't find anything that solves my
> doubt. Is there any way I can check if a variable is an file handler
> of an opened file?.

perldoc -f fileno


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Thu, 19 Jul 2007 18:44:39 -0700
From:  Jerry Krinock <jerry@sheepsystems.com>
Subject: Re: Use UTF-8 in Log::StdLog?
Message-Id: <1184895879.513864.166420@n60g2000hse.googlegroups.com>

Just one little correction in case someone else tries this, in Mumia's
code (2) the mode needs to be '>>:utf8' to append, instead of
'>:utf8'.



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

Date: Thu, 19 Jul 2007 23:35:13 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Using the split function
Message-Id: <s7mv93l61e83vcno14akvmo243qbsd7ecr@4ax.com>

On Thu, 19 Jul 2007 17:12:04 +0000 (UTC), steveo@panix.com (Steven M.
O'Neill) wrote:

>>It can be a one-liner in Perl too. Can grep format the output that
>>way?
>
>It doesn't need to.
>
>    :~>grep '^a.....s$' words | fmt

Fair enough...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 19 Jul 2007 22:20:48 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Using the split function
Message-Id: <slrnf9votn.i5.abigail@alexandra.abigail.be>

                                              _
Steven M. O'Neill (steveo@panix.com) wrote on VLXX September MCMXCIII in
<URL:news:f7o614$6ht$1@reader2.panix.com>:
??  Michele Dondi  <bik.mido@tiscalinet.it> wrote:
?? >On 19 Jul 2007 14:32:38 GMT, Lars Eighner <usenet@larseighner.com>
?? >wrote:
?? >
?? >>> Incredible what a man can do with /usr/dict/words and a perl
?? >>> interpreter...
?? >>
?? >>It's a one-liner in grep.  The right tool for the job, and all.
?? >
?? >It can be a one-liner in Perl too. Can grep format the output that
?? >way?
??  
??  It doesn't need to.
??  
??      :~>grep '^a.....s$' words | fmt
??      abigeus abiosis abortus abraxas abscess absciss acerous acetous
??      acinous acolous acomous actless actress aculeus acyesis addlins
??      address adipous adpress adzooks aeneous aerobus agamous ageless
??      aggress agnosis agogics agynous aidless aimless airless aitesis
??      algesis algosis aliptes allness alumnus amaltas amanous ambiens
??      ambitus amellus amorous amuguis anights animous annates annulus
??      anoesis anurous anxious anyways aphesis aphides aphodus apieces
??      apodous apropos apsides aptness apyrous aqueous arbutus archeus
??      arduous argeers arillus armless artless ascites asepsis ashless
??      assizes atelets atheous atokous atomics attacus auletes aureous
??      aurochs autobus auxesis avenous avidous awnless azotous azurous
??      azygous azymous
??  
??  (not sure why my output is so much less than Abigail's)


I guess I used a different line than you did.



Abigail
-- 
perl -wle'print"Êõóô áîïôèåò Ðåòì Èáãëåò"^"\x80"x24'


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

Date: Fri, 20 Jul 2007 02:00:03 +0000 (UTC)
From: steveo@panix.com (Steven M. O'Neill)
Subject: Re: Using the split function
Message-Id: <f7p4v3$iom$1@reader2.panix.com>

Abigail  <abigail@abigail.be> wrote:
>                                              _
>Steven M. O'Neill (steveo@panix.com) wrote on VLXX September MCMXCIII in
><URL:news:f7o614$6ht$1@reader2.panix.com>:
>??  Michele Dondi  <bik.mido@tiscalinet.it> wrote:
>?? >On 19 Jul 2007 14:32:38 GMT, Lars Eighner <usenet@larseighner.com>
>?? >wrote:
>?? >
>?? >>> Incredible what a man can do with /usr/dict/words and a perl
>?? >>> interpreter...
>?? >>
>?? >>It's a one-liner in grep.  The right tool for the job, and all.
>?? >
>?? >It can be a one-liner in Perl too. Can grep format the output that
>?? >way?
>??  
>??  It doesn't need to.
>??  
>??      :~>grep '^a.....s$' words | fmt
>??      abigeus abiosis abortus abraxas abscess absciss acerous acetous
>??      acinous acolous acomous actless actress aculeus acyesis addlins
>??      address adipous adpress adzooks aeneous aerobus agamous ageless
>??      aggress agnosis agogics agynous aidless aimless airless aitesis
>??      algesis algosis aliptes allness alumnus amaltas amanous ambiens
>??      ambitus amellus amorous amuguis anights animous annates annulus
>??      anoesis anurous anxious anyways aphesis aphides aphodus apieces
>??      apodous apropos apsides aptness apyrous aqueous arbutus archeus
>??      arduous argeers arillus armless artless ascites asepsis ashless
>??      assizes atelets atheous atokous atomics attacus auletes aureous
>??      aurochs autobus auxesis avenous avidous awnless azotous azurous
>??      azygous azymous
>??  
>??  (not sure why my output is so much less than Abigail's)
>
>I guess I used a different line than you did.

Either that, or a different words file.

-- 
Steven O'Neill                                  steveo@panix.com
Brooklyn, NY                        http://www.panix.com/~steveo


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

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 V11 Issue 663
**************************************


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