[25108] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7358 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 4 14:05:55 2004

Date: Thu, 4 Nov 2004 11:05:06 -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, 4 Nov 2004     Volume: 10 Number: 7358

Today's topics:
    Re: Best way to handle using a report template for non- <jwillmore@adelphia.net>
    Re: Best way to handle using a report template for non- <jwillmore@adelphia.net>
    Re: Check POP3 E-mail <dsgSPAMFILTER@alum.dartmouth.org>
        chr() and character set <dog@dog.dog>
    Re: chr() and character set <nobull@mail.com>
        Determining number of variables set as a sideeffect of  (machoq)
    Re: Determining number of variables set as a sideeffect <spamtrap@dot-app.org>
    Re: Determining number of variables set as a sideeffect <nobull@mail.com>
    Re: FAQ 2.1: What machines support Perl?  Where do I ge <ioneabu@yahoo.com>
        FAQ 8.35: How do I close a process's filehandle without <comdog@panix.com>
        Generating postscript file <bryan@akanta.net>
    Re: Generating postscript file <notvalid@email.com>
        How to scan Keyboard in Perl or else on Linux ? <Raphael.Rochet@xilinx.com>
    Re: How to scan Keyboard in Perl or else on Linux ? <mru@inprovide.com>
    Re: How to scan Keyboard in Perl or else on Linux ? <tadmc@augustmail.com>
    Re: Perl CGI project ideas <jwillmore@adelphia.net>
    Re: Perl CGI project ideas (krakle)
    Re: Q: re Inline and Benchmark (Anno Siegel)
    Re: Rlogin client? <vek@station02.ohout.pharmapartners.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 04 Nov 2004 06:19:38 -0500
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: Best way to handle using a report template for non-programmers..
Message-Id: <woadnSJ56b2hjRfcRVn-hg@adelphia.com>

Johnny Google wrote:
<snip>

> 1) I don't really need the embedded portions to be actual perl because
> I would rather it be more readable to someone who does not know perl.
> 2) I need to be able to handle looping (i.e. a parts list for an
> assembly)
> 3) I need to be able to specifiy exact column position formatting ...
> meaning I want to start info on at an exact position on a particular
> line even after a variable on that same line has been resolved ...
> For example:
> 
> 012345678901234567890123456789012345678901234567890123456789
> [DATE]                    [ENGINEER]         [ASSEMBLY NAME]
> 
> I need [ASSEMBLY NAME] to start at the same position no matter
> what the length of ENGINEER resolves to.
> 
> 
> If I were to code this in perl -- I would just ust formatted printing
> .... but I want to make this format changeable by a non-programmer - and
> have it living in a template file. I have only browsed the TEXT
> TEMPLATE/MAGIC modules at this point but it looks to me that the
> formatting would not handle starting a variable at a certain position
> down-the-line from a previously resolved variable.
> Any hints?

Not sure if this would help you, but you could try using 'pack' to 
format the output.

for example (using the /etc/passwd file as input)
#!/usr/bin/perl

use strict;
use warnings;

open(PASS, '/etc/passwd')
   or die "Can't open: $!\n";

while(<PASS>) {
   chomp;
   my @fields = (split /:/);
   my $output = pack 'A10 A2 A6 A6 A20 A15 A15', @fields;
   print "$output\n";
}


produces something like (output edited for security, brevity and 
formatting in email client):
postfix   x xx    xx 
/var/spool/post/sbin/nologin
mailman   x xx    xx    GNU Mailing List Man/var/mailman 
/sbin/nologin
amanda    x xx    xx     Amanda user 
/var/lib/amanda/bin/bash


'pack' is a Perl function, so someone who doesn't know Perl won't 
know what 'pack' does.  However, it is a basic Perl function, so 
it's not hard to find information out about how to use it (perldoc 
-f pack).  It handles looping and the output remains constant (which 
is what you wanted in requirements 2 and 3).  Although, it does 
truncate data and *you* have to be specific about what you want - 
meaning, you have to adjust for spaces between columns of information.

Again, may not be what you're looking for, but it's just AWTDI.

HTH

Jim


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

Date: Thu, 04 Nov 2004 08:19:47 -0500
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: Best way to handle using a report template for non-programmers..
Message-Id: <laGdncfBMvH4sRfcRVn-qA@adelphia.com>

James Willmore wrote:
> Johnny Google wrote:
> <snip>
> 
>> 1) I don't really need the embedded portions to be actual perl because
>> I would rather it be more readable to someone who does not know perl.
<snip>
> Not sure if this would help you, but you could try using 'pack' to 
> format the output.
> 
> for example (using the /etc/passwd file as input)
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> open(PASS, '/etc/passwd')
>   or die "Can't open: $!\n";
> 
> while(<PASS>) {
>   chomp;
>   my @fields = (split /:/);
>   my $output = pack 'A10 A2 A6 A6 A20 A15 A15', @fields;
>   print "$output\n";
> }
<snip>

> Again, may not be what you're looking for, but it's just AWTDI.

Just to expand on the example above and to separate out the "look 
and feel" aspect from the "business logic" aspect, below may be more 
along the lines of what you were looking for ... maybe.

First, define a "template" to use (which is nothing more than field 
descriptions and what pack format to use):

--start--
username A10
password A9
uid A6
gid A6
ecos A20
home A15
shell A15
--end--

and then use the following script to apply the "template" to the 
input file:

--start--
#!/usr/bin/perl

use strict;
use warnings;

#define your template and input file
#use the file 'template' and '/etc/passwd' as defaults
my $template = shift || 'template';
my $input = shift || '/etc/passwd';

#open tenplate file and read its contents

open(TEMPLATE, $template)
   or die "Can't open template file: $!\n";

my @description;
my $packFormat;
while(<TEMPLATE>) {
   chomp;
   my($desc, $form) = (split);
   push @description, $desc;
   $packFormat .= "$form ";
}

close TEMPLATE;

#now open the actual file, read its contents and
#print according to the pack format

open(PASS, $input)
   or die "Can't open password file: $!\n";

my $heading = pack $packFormat, @description;
print "$heading\n";

while(<PASS>) {
   chomp;
   my @fields = (split /:/);
   my $output = pack $packFormat, @fields;
   print "$output\n";
}

close PASS;
--end--

The above code needs more work (like using one of the Getopts 
modules to parse the command line options, better handling of the 
template file, etc.), but may be more along the lines of what you're 
looking for.

Most modules I've seen requires *some* understanding of Perl. 
However, the above *might* be the "poor man's" way of doing it so 
anyone can edit the template file and not be too concerned with the 
inner workings of Perl.

HTH

Jim


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

Date: Thu, 4 Nov 2004 10:37:56 -0500
From: "David Gale" <dsgSPAMFILTER@alum.dartmouth.org>
Subject: Re: Check POP3 E-mail
Message-Id: <2uv0rjF2fh0d0U1@uni-berlin.de>

Quoth John W. Krahn <someone@example.com>:
> David Gale wrote:
>> Quoth A. Sinan Unur <1usa@llenroc.ude.invalid>:
>>> There is no need to explictly initialize my variables.
>>
>> Nor does it hurt to do so, and is a good habit to get into, in case
>> you're ever in an environment when you can't choose which language
>> to program in, and have to use something (say, C) which does not
>> implicitly initialize variables.
>
> According to the C FAQ:
>
> Variables with static duration (that is, those declared outside of
> functions, and those declared with the storage class static), are
> guaranteed initialized (just once, at program startup) to zero, as if
> the programmer had typed ``= 0''. Therefore, such variables are
> initialized to the null pointer (of the correct type; see also
> section 5) if they are pointers, and to 0.0 if they are
> floating-point.

Ok, there's one situation in which C pre-initializes variables.  However,
that's a rather rare one.  Most variables are non-static (declared inside
functions, such as main(), and without the static storage class), and thus
not pre-initialized.  Pointers are an extreme example, but very, very
common.

Personally, I initialize my static variables explicitly, even though they
are implicitly initialized, because it makes it clearer and far less likely
to lead to hard-to-find bugs (example: in a code re-write, you realize that
a variable doesn't need to be static, so you remove the keyword, but forget
to add in an initialization...might work some of the time, but not all the
time.)




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

Date: Thu, 4 Nov 2004 18:13:18 +0100
From: "Peter Michael" <dog@dog.dog>
Subject: chr() and character set
Message-Id: <cmdnvq$rm2$1@tgx093.str.allianz.de>

Hi,

perlfunc(1) says about chr()

    Returns the character represented by that NUMBER in the
    character set.

Which character set is this exactly and how can it be
controlled programmatically (in particular for arguments in
the range 128..255)? 

Thanks for any hints.

    Peter



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

Date: Thu, 04 Nov 2004 18:39:30 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: chr() and character set
Message-Id: <cmdsnu$t02$1@sun3.bham.ac.uk>



Peter Michael wrote:

> perlfunc(1) says about chr()
> 
>     Returns the character represented by that NUMBER in the
>     character set.
> 
> Which character set is this exactly and how can it be
> controlled programmatically (in particular for arguments in
> the range 128..255)? 

The short answer is Unicode.  Which IIRC is the same as ISO-Latin1 for 
that range.

But for details read the rest of the entry where it goes on to explain 
all this.

If it doesn't then your version of Perl is old and doesn't understand 
character sets.  In that case strings are simply strings of bytes and 
the concept of "which character set" does not apply.



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

Date: 4 Nov 2004 07:02:57 -0800
From: spamsaket@yahoo.com (machoq)
Subject: Determining number of variables set as a sideeffect of pattern match
Message-Id: <e715de76.0411040702.6f0c19e@posting.google.com>

I ask the user to provide me as an argument a perl-pattern
I need to return the user a hash containing the variables which were
set as a sideeffect of the pattern match

So if pattern is /(A+)B(C*)/
it will set 2 variables $1 and $2.... and I can push them in my hash
but what happens if the pattern is dynamic...the user provides the
pattern and i do not know how many $1...$2...$n will it set ?

Is there a way i can identify how many variables are available for me
to consume ? Is there a limit on how many variables will be set as a
sideeffect of a match ?

Thanks
-Machoq


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

Date: Thu, 04 Nov 2004 10:41:40 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Determining number of variables set as a sideeffect of pattern match
Message-Id: <y8OdnRSiO-8p0BfcRVn-3A@adelphia.com>

machoq wrote:

> So if pattern is /(A+)B(C*)/
> it will set 2 variables $1 and $2.... and I can push them in my hash
> but what happens if the pattern is dynamic...the user provides the
> pattern and i do not know how many $1...$2...$n will it set ?
> 
> Is there a way i can identify how many variables are available for me
> to consume?

A match in list context returns a list of matched subpatterns:

my @subpatterns = (foo =~ /(A+)B(C*))/;

Any returned list means a successful match, so this can also be used to 
easily assign subpatterns to lexical variables that are local to a 
conditional block:

if (0 != (my ($foo, $bar) = ($text =~ /(A+)B(C*)/)))
     # Do stuff with $foo and $bar
}

> Is there a limit on how many variables will be set as a
> sideeffect of a match ?

No idea. If there is, I haven't bumped into it yet.

sherm--

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


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

Date: Thu, 04 Nov 2004 18:25:07 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Determining number of variables set as a sideeffect of pattern match
Message-Id: <cmdrt0$sn4$1@sun3.bham.ac.uk>


machoq wrote:

> I ask the user to provide me as an argument a perl-pattern
> I need to return the user a hash 

Hash?  Why not just a list (or array)?

> containing the variables which were
> set as a sideeffect of the pattern match
> 
> So if pattern is /(A+)B(C*)/
> it will set 2 variables $1 and $2.... and I can push them in my hash
> but what happens if the pattern is dynamic...the user provides the
> pattern and i do not know how many $1...$2...$n will it set ?

You say "will set"? Are you sure you need this information in advance? 
It's easily available after the pattern has matched but rather harder to 
get it beforehand.

After a successful match the $#+ and $#- special variables will tell you 
the total number of captures and the number of the last succesful 
capture respetively.

Except that you can't completely trust $#-.

'wibble' =~ /(i)|(x)/; # $#+=2 $#-=1 this is good
'wibble' =~ /(i)(x)?/; # $#+=2 $#-=2 this is bad


> Is there a way i can identify how many variables are available for me
> to consume ?

$#+

But if you are using m// without /g then you can simply use the list 
context return value of the m// and sidestep the whole issue.

> Is there a limit on how many variables will be set as a
> sideeffect of a match ?

Not that I know of.



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

Date: Thu, 04 Nov 2004 14:01:29 -0500
From: wana <ioneabu@yahoo.com>
Subject: Re: FAQ 2.1: What machines support Perl?  Where do I get it?
Message-Id: <10okrpu6bjsp3a3@news.supernews.com>

PerlFAQ Server wrote:

> This message is one of several periodic postings to comp.lang.perl.misc
> intended to make it easier for perl programmers to find answers to
> common questions. The core of this message represents an excerpt
> from the documentation provided with Perl.
> 
> --------------------------------------------------------------------
> 
> 2.1: What machines support Perl?  Where do I get it?
> 
>     The standard release of Perl (the one maintained by the perl
>     development team) is distributed only in source code form. You can
>     find this at http://www.cpan.org/src/latest.tar.gz , which is in a
>     standard Internet format (a gzipped archive in POSIX tar format).
> 
>     Perl builds and runs on a bewildering number of platforms. Virtually
>     all known and current Unix derivatives are supported (Perl's native
>     platform), as are other systems like VMS, DOS, OS/2, Windows, QNX,
>     BeOS, OS X, MPE/iX and the Amiga.
> 

What about Pocket PC (a version of win ce)?  I did find a version of Perl
for Pocket PC by searching Google, but part of the installation involves
editing the registry.  I never bothered because I like to imagine that
someday a friend or co-worker might benefit from one of my programs and I
would hate to ask them to edit the registry as part of the installation
process.

Are there any ports to Pocket PC that you can install on the device itself
with no additional configuration?  I have a Dell Axim.  These machines are
actually relatively powerful computers with a lot of potential.  It's just
that the only languages that are really convenient to use are embedded
visual c++ and basic.  A good, complete port of Perl with all of the
networking ability etc.. would really be revolutionary.  Laptops and tablet
PC's are ok, but nothing beats carrying your programs in your pocket and
being able to turn them on in an instant.  Imagine what you could do with
the built in wifi network cards that come with most handhelds now.  

If nothing else, I can at least format my web CGI programs to look nice on
the little screen.

wana 


>     Binary distributions for some proprietary platforms, including Apple
>     systems, can be found http://www.cpan.org/ports/ directory. Because
>     these are not part of the standard distribution, they may and in fact
>     do differ from the base Perl port in a variety of ways. You'll have to
>     check their respective release notes to see just what the differences
>     are. These differences can be either positive (e.g. extensions for the
>     features of the particular platform that are not supported in the
>     source release of perl) or negative (e.g. might be based upon a less
>     current source release of perl).
> 
> 
> 
> --------------------------------------------------------------------
> 
> Documents such as this have been called "Answers to Frequently
> Asked Questions" or FAQ for short.  They represent an important
> part of the Usenet tradition.  They serve to reduce the volume of
> redundant traffic on a news group by providing quality answers to
> questions that keep coming up.
> 
> If you are some how irritated by seeing these postings you are free
> to ignore them or add the sender to your killfile.  If you find
> errors or other problems with these postings please send corrections
> or comments to the posting email address or to the maintainers as
> directed in the perlfaq manual page.
> 
> Note that the FAQ text posted by this server may have been modified
> from that distributed in the stable Perl release.  It may have been
> edited to reflect the additions, changes and corrections provided
> by respondents, reviewers, and critics to previous postings of
> these FAQ. Complete text of these FAQ are available on request.
> 
> The perlfaq manual page contains the following copyright notice.
> 
>   AUTHOR AND COPYRIGHT
> 
>     Copyright (c) 1997-2002 Tom Christiansen and Nathan
>     Torkington, and other contributors as noted. All rights
>     reserved.
> 
> This posting is provided in the hope that it will be useful but
> does not represent a commitment or contract of any kind on the part
> of the contributers, authors or their agents.



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

Date: Thu, 4 Nov 2004 17:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 8.35: How do I close a process's filehandle without waiting for it to complete?
Message-Id: <cmdnc5$ial$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

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

8.35: How do I close a process's filehandle without waiting for it to complete?

    Assuming your system supports such things, just send an appropriate
    signal to the process (see "kill" in perlfunc). It's common to first
    send a TERM signal, wait a little bit, and then send a KILL signal to
    finish it off.



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

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


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

Date: Thu, 04 Nov 2004 17:52:54 GMT
From: BCC <bryan@akanta.net>
Subject: Generating postscript file
Message-Id: <W%tid.38528$QJ3.25725@newssvr21.news.prodigy.com>

Does anyone know of a perl module like GD that will allow me to draw 
with colors and shapes and save it as a postscript file?  GD doesnt give 
me that option unfortunately.

Looked in CPAN and didnt see anything.

Thanks


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

Date: Thu, 04 Nov 2004 18:05:50 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Generating postscript file
Message-Id: <2cuid.4636$zx1.2398@newssvr13.news.prodigy.com>

BCC wrote:
> Does anyone know of a perl module like GD that will allow me to draw 
> with colors and shapes and save it as a postscript file?  GD doesnt give 
> me that option unfortunately.

Could be overkill, but a Tk::Canvas allows you to dump the contents of 
the canvas as a postscript file. It is part of Tk which is a GUI 
toolkit, so you won't find all of the functionality offered by 
graphics-specific modules like GD.

--Ala


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

Date: Thu, 04 Nov 2004 17:45:43 +0100
From: =?ISO-8859-1?Q?Rapha=EBl?= <Raphael.Rochet@xilinx.com>
Subject: How to scan Keyboard in Perl or else on Linux ?
Message-Id: <cmdmbo$nsd1@cliff.xsj.xilinx.com>

Hi,

On Linux, does somebody know how to get the keyboard status in Perl ?

I explane :
-> I would like to write a Perl script which scan the keyboard and 
return the list of pressed keys.

For example, let "keyboard_scan()" be the name of this function, with 
the following behavior:

	- When keyboard_scan() is called, if the user is pressing no keys, I 
would like keyboard_scan() to return the empty string "".
	- When keyboard_scan() is called, if the user is pressing the CTRL key, 
I would like keyboard_scan() to return the code string of the CTRL key.
	- When keyboard_scan() is called, if the user is pressing the ALT key 
and the SHIFT key, I would like the function to return the string 
containing the code of the SHIFT key and the code of the ALT key.
etc ...

Or perhaps somebody knows how to do it in another language (C, TCL, ...) ?

Thanks !

Raphaël.


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

Date: Thu, 04 Nov 2004 18:15:14 +0100
From: =?iso-8859-1?q?M=E5ns_Rullg=E5rd?= <mru@inprovide.com>
Subject: Re: How to scan Keyboard in Perl or else on Linux ?
Message-Id: <yw1xbredcz8d.fsf@ford.inprovide.com>

Raphaël <Raphael.Rochet@xilinx.com> writes:

> Hi,
>
> On Linux, does somebody know how to get the keyboard status in Perl ?
>
> I explane :
> -> I would like to write a Perl script which scan the keyboard and
> return the list of pressed keys.
>
> For example, let "keyboard_scan()" be the name of this function, with
> the following behavior:
>
> 	- When keyboard_scan() is called, if the user is pressing no
> 	keys, I would like keyboard_scan() to return the empty string
> 	"".
> 	- When keyboard_scan() is called, if the user is pressing the
> 	CTRL key, I would like keyboard_scan() to return the code
> 	string of the CTRL key.
> 	- When keyboard_scan() is called, if the user is pressing the
> 	ALT key and the SHIFT key, I would like the function to return
> 	the string containing the code of the SHIFT key and the code
> 	of the ALT key.
> etc ...
>
> Or perhaps somebody knows how to do it in another language (C, TCL, ...) ?

Are you running under X?  Look at the source of xkbwatch.  It displays
the status of the modifier keys.

-- 
Måns Rullgård
mru@inprovide.com


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

Date: Thu, 4 Nov 2004 11:33:14 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to scan Keyboard in Perl or else on Linux ?
Message-Id: <slrncokpuq.bs4.tadmc@magna.augustmail.com>

Raphaël <Raphael.Rochet@xilinx.com> wrote:

> does somebody know how to get the keyboard status in Perl ?


Have you already seen the 3 Perl FAQs about keyboards?

   perldoc -q keyboard

       How can I read a single character from a file?  From the keyboard?
       How do I do fancy stuff with the keyboard/screen/mouse?
       How do I check whether input is ready on the keyboard?


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


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

Date: Thu, 04 Nov 2004 06:43:49 -0500
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: Perl CGI project ideas
Message-Id: <gKednZUTOPJ1iBfcRVn-qw@adelphia.com>

bharat.shetty@gmail.com wrote:

> We have a project to develop a simple application on Linux using Perl
> and CGI. I have been totally devoid of ideas for my project becuase
> whatever I thought is being done . Could anyone provide me with gist of
> ideas for my project. I would appreciate if someone points me to a
> necessary application that doesnt exist on Linux but on windoze. Since
> I dont have too much time left , really K I S S ideas are requested.
> Also which books should i read as i am relatively a Perl / CGI newbie

A random story generator based upon user input.  It's simple and can 
be fun.  I don't think there's hundreds of scripts out there that do 
this (at least, none of any consequence).

If one has coded properly and for portability, it doesn't matter 
what OS or web server software you use (re the comment about "... 
doesnt exist on Linux but on windoze").  This is/was the idea behind 
the CGI (Common Gateway Interface) to begin with - OS independence :-)

HTH

Jim


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

Date: 4 Nov 2004 08:34:09 -0800
From: krakle@visto.com (krakle)
Subject: Re: Perl CGI project ideas
Message-Id: <237aaff8.0411040834.4a21a955@posting.google.com>

shb*NO*SPAM*@comporium.net (Si Ballenger) wrote in message news:<4189c8f1.179184123@news.comporium.net>...
> On 3 Nov 2004 21:47:28 -0800, krakle@visto.com (krakle) wrote:
> >Oh yea you are a complete moron...
> 
> Have you ever tried decaff?  ;-)


Not yet.


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

Date: 4 Nov 2004 13:25:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Q: re Inline and Benchmark
Message-Id: <cmdakr$s0p$1@mamenchi.zrz.TU-Berlin.DE>

Sisyphus  <kalinaubears@iinet.net.au> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > Michele Dondi  <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> > 
> > [...]
> > 
> > 
> >>and if needed I will stick to that. However, more generally speaking,
> >>is there a way I can take a reference of an Inline sub?
> > 
> > 
> > It's in no way different from a normal sub: "\&foo".
> 
> Hmmm ... that's not what I'm finding.
> 
> If I do \&foo all I get is a "Usage:" warning telling me that it needs 
> to be foo() - and when I try \&foo() I get a slightly different "usage:" 
> warning telling me (in effect) that I need to use 'timethis' (and *no* 
> sub reference) instead of 'cmpthese' (with a sub reference).

That's an artifact of Benchmark.  Inline checks parameters and gives
the "usage" message you've seen when (for instance) a function requiring
no arguments is called with arguments.  Benchmark calls a given
coderef in the form "&$subref;" (line 646 in v 1.051), so if @_ happens to
be non-empty at this point, the error occurs.

Prototyped Perl subs would have a similar problem.  Time for a bug report,
I guess...   And another lesson why one shouldn't call arbitrary subs
with &.

Anno


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

Date: 04 Nov 2004 11:12:58 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: Rlogin client?
Message-Id: <slrncok3lq.6s5.vek@station02.ohout.pharmapartners.nl>

On 04 Nov 2004 08:37:38 GMT,
    Abigail <abigail@abigail.nl> wrote:


> Jean-Louis Leroy (jll@soundobjectlogic.com) wrote on MMMMLXXXIII
> September MCMXCIII in <URL:news:lzlldi6n2h.fsf@toots.sol>:
> ??  Abigail <abigail@abigail.nl> writes:
> ??  
> ?? > Jean-Louis Leroy (jll@soundobjectlogic.com) wrote on MMMMLXXXII September
> ?? > MCMXCIII in <URL:news:lzk6t2sxl4.fsf@toots.sol>:
> ?? > }}  Anybody knows of a rlogin client-in-a-module? Surprisingly I don't
> ?? > }}  find one on CPAN.
> ??  
> ?? > You might want to try Net::Telnet.
> ??  
> ??  Telnet and rlogin don't use the same protocol, do they?
>
> No, but you can use your telnet client to connect to an rlogin port
> as well. You might need to talk a bit of rlogin protocol yourself.
>

It may not be so easy to ensure that the client port is below 1024.
The rlogin server usualy refuses to talk to a client which uses
a normal auto assigned client port number.  On unix that even requires
that the client has super user privileges.

Villy


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

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


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