[11762] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5361 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 12 14:07:31 1999

Date: Mon, 12 Apr 99 11:00:25 -0700
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, 12 Apr 1999     Volume: 8 Number: 5361

Today's topics:
        Alphanumeric pagers <maloneyd@bms.com>
    Re: Alphanumeric pagers (Jason)
    Re: Blessed nature (Sys Adm 89806 Manager of programing development and Intranet Resources)
    Re: chmod of a file on a unix platform (Abigail)
    Re: Compiling Perl Scripts <cassell@mail.cor.epa.gov>
    Re: Count Linenumber (Abigail)
    Re: DBI help (Steve Linberg)
        Executing perl code from separate files <kubla_khan@rocketmail.com>
    Re: Executing perl code from separate files (Steve Linberg)
        Getting long filename from 8.3 filename? hgelman@ntia.doc.gov
    Re: Hash symbol '%' a stylized what? <cassell@mail.cor.epa.gov>
    Re: Hash symbol '%' a stylized what? (Abigail)
        Help with submiting a form from a script <alejandro.eluchans@umb.edu>
        How do I delete text in a file? <grichard@uci.edu>
    Re: How do I delete text in a file? (Steve Linberg)
    Re: How do I delete text in a file? (Sys Adm 89806 Manager of programing development and Intranet Resources)
    Re: I realy need some help... (Abigail)
    Re: installing libnet on win32 (Jonathan Stowe)
    Re: Is it possible to have "..." appear while processin (Abigail)
    Re: is there any ceiling function in perl? <droby@copyright.com>
    Re: Move from IIS, ASP, COM, Java to Linux, Apache, mod <cassell@mail.cor.epa.gov>
        newbie question - blank form fields and selections <mikej@1185design.com>
    Re: newbie to Perl (Abigail)
    Re: Perl as a first programming language - suitability, <tony@cyberscape.net>
    Re: Perl Development Environment (Abigail)
    Re: Perl Development Environment (Sys Adm 89806 Manager of programing development and Intranet Resources)
    Re: Perl or C? (Abigail)
    Re: Reading piped Data from STDIN on NT <ebohlman@netcom.com>
    Re: RTFM please!  perldoc PSI::ESP (was Re: Validating  <emschwar@rmi.net>
    Re: RTFM please!  perldoc PSI::ESP (was Re: Validating  (I R A Aggie)
    Re: SORT BY DATE (M.J.T. Guy)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 12 Apr 1999 17:32:43 +0000
From: "Daniel P. Maloney" <maloneyd@bms.com>
Subject: Alphanumeric pagers
Message-Id: <37122E3B.61A56CE@bms.com>

This is a multi-part message in MIME format.
--------------81A7458F8EB15DF04EEB25D2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I once saw a Perl module somewhere for sending text messages to
alphanumeric pagers via modem using the TAP protocol. Thought I'd never
need it, so like an idiot, I didn't grab it. Now I need it. Does this
beast still exist? Thanks for any help...
--------------81A7458F8EB15DF04EEB25D2
Content-Type: text/x-vcard; charset=us-ascii;
 name="maloneyd.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Daniel P. Maloney
Content-Disposition: attachment;
 filename="maloneyd.vcf"

begin:vcard 
n:Maloney;Daniel
tel;pager:860 473-3645
tel;cell:203 410-1304
tel;fax:203 677-6417
tel;home:as if...
tel;work:203 677-7135
x-mozilla-html:TRUE
url:http://hollywood.wfd.pri.bms.com
org:Bristol-Myers Squibb Co.
version:2.1
email;internet:maloneyd@bms.com
title:Research Automation Engineer
note:Opinions expressed are mine alone...
adr;quoted-printable:;;5 Research Parkway=0D=0ADept. 114;Wallingford;CT;06492;USA
x-mozilla-cpt:;2912
fn:Maloney, Daniel
end:vcard

--------------81A7458F8EB15DF04EEB25D2--



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

Date: 12 Apr 1999 17:45:44 GMT
From: robobob@blech.mindwell.com (Jason)
Subject: Re: Alphanumeric pagers
Message-Id: <slrn7h4ca8.2v.robobob@blech.mindwell.com>

On Mon, 12 Apr 1999 17:32:43 +0000, Daniel P. Maloney <maloneyd@bms.com> wrote:
>
>I once saw a Perl module somewhere for sending text messages to
>alphanumeric pagers via modem using the TAP protocol. Thought I'd never
>need it, so like an idiot, I didn't grab it. Now I need it. Does this
>beast still exist? Thanks for any help...
>
I have never seen a module that uses TAP directly, but there is Net::SNPP
for talking to SNPP servers (such as hylafax www.hylafax.org), which then
send the page via IXO/TAP.

-- 
        Jason Kohles -- jason@mediabang.com
        http://www.mediabang.com/

          "This is as bad as it can get, but don't bet on it."


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

Date: 12 Apr 1999 16:31:46 GMT
From: ruben@llinderman.dental.nyu.edu (Sys Adm 89806 Manager of programing development and Intranet Resources)
Subject: Re: Blessed nature
Message-Id: <7et75i$7in$2@news.nyu.edu>

In article <7et14k$5hb$1@news.nyu.edu>,
	ruben@llinderman.dental.nyu.edu (Sys Adm 89806 Manager of programing development and Intranet Resources) writes:
> Hello -
> 
> I'm a little confused by what I gain by using bless.  In O'Reilly's advanced
> perl book, it gives this example:
> 
> package RegularEmployee;
> sub new {
>    my ($name, $age, $starting_position, $monthly_salary) = @_;
>    my $r_employee = {
> 		"name"      => $name,
>                 "age"       => $age,
>                 "position"  => $starting_position,
>                 "monthly_salary => $monthly_salary,
>                 "months_worked" => 0,
>                  };
>    bless $r_employee, 'RegularEmployee';
>    return $r_employee;
> 
> sub promote{
>    ...
> }
> 
> sub compute_ytd_income{
>    ...
> }
> package RegularEmployee;
> sub new {
>    my ($name, $age, $starting_position, $monthly_salary) = @_;
>    my $r_employee = {
>                 "name"      => $name,
>                 "age"       => $age,
>                 "position"  => $starting_position, 
>                 "monthly_salary => $monthly_salary,
>                 "months_worked" => 0,
>                  };
>    bless $r_employee, 'RegularEmployee';
>    return $r_employee;                
> }
> sub promote{
>    ...
> }
>  
> sub compute_ytd_income{
>    ...
> }
>  
> 
> 
> 
> package HourlyEmployee;
> sub new {
>    my ($name, $age, $starting_position, $monthly_salary) = @_;
>    my $r_employee = {
> 		"name"      => $name,
>                 "age"       => $age,
>                 "position"  => $starting_position,
>                 "hoursly_rate" => $hourly_rate,
>                 "overtime_rate" => $overtime_rate 
>                 };
>    bless $r_employee, 'HourlyEmployee';
>    return $r_employee;
> }
> sub promote{
>    ...
> }
> 
> sub compute_ytd_income{
>    ...
> }
> package RegularEmployee;
> sub new {
>    my ($name, $age, $starting_position, $monthly_salary) = @_;
>    my $r_employee = {
>                 "name"      => $name,
>                 "age"       => $age,
>                 "position"  => $starting_position, 
>                 "monthly_salary => $monthly_salary,
>                 "months_worked" => 0,
>                  };
>    bless $r_employee, 'RegularEmployee';
>    return $r_employee;                
> 
> sub promote{
>    ...
> }
>  
> sub compute_ytd_income{
>    ...
> }
> 
> 
> 
> 
> 
> Then the usage example is:
> $emp1 = RegularEmployee::new('John Doe', 32, 'Software Engineer', 5000);
> $emp2 = HourlyEmployee::new('Jane Smith', 35, 'Auditor', 65, 90);
> 
> $emp1->promote();
> $emp2->compute_ytd_income();
> 
> 
> I don't see anything I could not do without bless, unless I'm missing the point.
> 
> Because I have to call the constructor, each package needs to be memorized
> by the user.  the use of 
> 
> use RegularEmployee;
> 
> does all of this for me without bless, do it not?
> 
> 
> Ruben
>  
> 


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

Date: 12 Apr 1999 16:40:22 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: chmod of a file on a unix platform
Message-Id: <7et7lm$1un$2@client2.news.psi.net>

Marco Vlemmings (marcov@ctrl-v.nl) wrote on MML September MCMXCIII in
<URL:news:3711E5FF.37AEAD5B@ctrl-v.nl>:
[] 
[] I have a problem. I want to change the directory permissions. The owner
[] of the directory is 'marco', but when i use the code 'chmod 0755, $dir'
[] the directory still has the same permissions as before '0733'. Am i
[] doing something wrong. I know a little bit about Unix.Can anybody help
[] me?


What's the return value of chmod? If false, what's $!?



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Mon, 12 Apr 1999 09:44:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Compiling Perl Scripts
Message-Id: <371222EC.644EB694@mail.cor.epa.gov>

Sam Holden wrote:
> 
> On Sun, 11 Apr 1999 16:50:04 GMT, JDDemme <jddemme@technologist.com> wrote:
> >EXE's are platform-dependant, so no..... But, if you want a
> >platform-independant program(not script), your best bet is JAVA....  You may
> >be able to find a program to convert perl code to java code.........
> >Maybe.....
> >If you do, please let me know.

Umm, that's Java, not JAVA.  Like Perl, rather than PERL.  No problem,
jddEMMe.  :-)

If you want to play with both, you should check out JPL, the Java-Perl
Library.

> Java needs a VM with a large amount of library classes...
> Perl needs an interpreter with a large amount of modules...
> 
> How does Java gain you anything?
> 
> I would expect that perl is available on more platforms than Java is.

As I understand the current state, Java works properly (all tests) on 
three platforms. [source: InfoWorld]  Perl works properly on nearly 
everything.  If portability on a large number of platforms is the 
issue, I think the [current] answer is clear.  However, I expect a 
number of platforms to fix up their Java VMs in the near future.

-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 12 Apr 1999 16:44:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Count Linenumber
Message-Id: <7et7sl$1un$3@client2.news.psi.net>

Larry Rosler (lr@hpl.hp.com) wrote on MMXLIX September MCMXCIII in
<URL:news:MPG.117993c0504df2f1989889@nntp.hpl.hp.com>:
:: 
:: In article <370FD664.4B6F484A@xs4all.nl> on Sun, 11 Apr 1999 00:53:24 
:: +0200, Frank de Bot <debot@xs4all.nl >says...
:: > How can I count the number of lines  WITHOUT a loop in a file?
:: 
:: You cannot.
:: 
:: The following is the shortest code I can think of:
:: 
::     0 while <FILE>;
::     print "$.\n";


This is the shortest code I can think of:

       perl -wlpe '}{$_=$.' file




Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: Mon, 12 Apr 1999 13:03:10 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: DBI help
Message-Id: <linberg-1204991303100001@ltl1.literacy.upenn.edu>

In article <C0ddgAAjihE3EwXJ@weaverweb.co.uk>, David Stringer
<david@weaverweb.co.uk> wrote:

> Help
> 
> I have been trying to use DBI with mysql. I installed both with CPAN and
> it seemed to go fine.
> 
> when I use the connect method i.e...
> 
> $dsn = "DBI:mysql:database=test";
> $dbh = $dsn->connect($dsn, test, whatsit);

$dbh = DBI->connect("DBI:mysql:test", "username", "password") or die
"bleh: $DBI::errstr";

 ...etc.  HTH.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Mon, 12 Apr 1999 12:56:42 +0100
From: Kubla Khan <kubla_khan@rocketmail.com>
Subject: Executing perl code from separate files
Message-Id: <3711DF7A.4236A63A@rocketmail.com>

I want to read and execute separate files containing perl code from one
'main' perl program and retrieve the output.
Is reading the files in and using eval the best way to accomplish this?




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

Date: Mon, 12 Apr 1999 13:07:04 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Executing perl code from separate files
Message-Id: <linberg-1204991307040001@ltl1.literacy.upenn.edu>

In article <3711DF7A.4236A63A@rocketmail.com>, Kubla Khan
<kubla_khan@rocketmail.com> wrote:

> I want to read and execute separate files containing perl code from one
> 'main' perl program and retrieve the output.
> Is reading the files in and using eval the best way to accomplish this?

You can eval files directly, if you want, but be sure you trust their
contents and aren't going to complain if one of them contains '`rm -rf
/`;' or something equally evil.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Mon, 12 Apr 1999 17:14:04 GMT
From: hgelman@ntia.doc.gov
Subject: Getting long filename from 8.3 filename?
Message-Id: <7et9kl$q3$1@nnrp1.dejanews.com>



I have a short perl script that will run under Windows, and I've made it into
an executable through perl2exe.  Ideally, I'd like to drag a file onto the
executable, and then process that file in the perl script.  Unfortunately,
the Windows Explorer is stupidly passing the 8.3 filename (e.g.,
"this is a long file.txt" becomes "thisis~1.txt").  That's useless to me,
since I actually need to extract info from the filename.  I did a Dejanews
search and found other people who had this problem, but the solutions offered
were always Visual Basic or Visual C.  Does anyone know of a way I can get
the full, long filename from ActiveState Perl?

I don't mind if it's somewhat ugly -- a small executable written in any
language which would let me drag a file onto it and then it would run my
program with the correct filename would be acceptable.

Thanks
Herschel

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 12 Apr 1999 09:33:47 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <3712206B.123F00F5@mail.cor.epa.gov>

John Callender wrote:
> 
> I recall reading something somewhere (in a man page? an O'Reilly book?)
> that gave a mnemonic device for remembering which symbols go with which
> types of Perl variables:
> 
> $ is a stylized 's' for 'scalar'
> @ is a stylized 'a' for 'array'

page 4 of the blue Camel book.

There is no specific mnemonic given for `%'.
But Table 1-1 on that page has some amusing names showing the syntax:

$cents
@large
%interest
&how
*struck

> but I can't remember what, if anything, the hash's '%' was supposed to
> represent, and I haven't been able to track down the original source.
> 
> I have a vague sense that this was Larry Himself promulgating this
> wisdom, but I could be wrong.

Well, Larry is the lead author of the book.  So at a minimum he gave
his explicit consent.  Umm, pardon me, I see from the rest of this
thread
that I should have said 'Lawrence'.  Terribly sorry about that, old
bean.
 
> Anyway, I'm sure there are about 150 people (at least) who will
> remember where this came from more or less instantly. If one or more of
> those people will take pity on me and tell me where I can look up the
> original, I'd appreciate it. Thanks.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 12 Apr 1999 17:06:13 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <7et965$2ic$1@client2.news.psi.net>

John Callender (jbc@shell2.la.best.com) wrote on MMXLIX September
MCMXCIII in <URL:news:3710b9eb$0$216@nntp1.ba.best.com>:
<> I recall reading something somewhere (in a man page? an O'Reilly book?)
<> that gave a mnemonic device for remembering which symbols go with which
<> types of Perl variables:
<> 
<> $ is a stylized 's' for 'scalar'
<> @ is a stylized 'a' for 'array'
<> 
<> but I can't remember what, if anything, the hash's '%' was supposed to
<> represent, and I haven't been able to track down the original source.


Those little "dots" in a '%' are actually tiny a's. Which makes a lot
of sense, cause hashes used to be named 'associative arrays'.




Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Mon, 12 Apr 1999 13:12:08 -0500
From: Alejandro Eluchans <alejandro.eluchans@umb.edu>
Subject: Help with submiting a form from a script
Message-Id: <37123778.E3EB0D42@umb.edu>

Does any body know how to submit a form (name/value form entries) that
is located in a PERL script (like a browser), so I may use the return
(from the cgi) with the PERL script.

Alejandro



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

Date: Mon, 12 Apr 1999 09:15:26 -0700
From: "Gabriel Richards" <grichard@uci.edu>
Subject: How do I delete text in a file?
Message-Id: <7et5vr$95n@news.service.uci.edu>

Is there a function which will allow me to delete text from a file? I want
to delete all the tags in an HTML file just leaving the content.

Gabe




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

Date: Mon, 12 Apr 1999 12:59:07 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: How do I delete text in a file?
Message-Id: <linberg-1204991259070001@ltl1.literacy.upenn.edu>

In article <7et5vr$95n@news.service.uci.edu>, "Gabriel Richards"
<grichard@uci.edu> wrote:

> Is there a function which will allow me to delete text from a file?

No, but you can read a file into memory, delete text from it, and write it
back out.

> I want
> to delete all the tags in an HTML file just leaving the content.

Look into HTML::Parse (or HTML::Parser, I can never remember which one is
current and which is old) on CPAN.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: 12 Apr 1999 17:16:07 GMT
From: ruben@llinderman.dental.nyu.edu (Sys Adm 89806 Manager of programing development and Intranet Resources)
Subject: Re: How do I delete text in a file?
Message-Id: <7et9on$9b1$3@news.nyu.edu>

You cound write the function.

Here is a start

sub htmlbegone{
  my (filename) = @_;
  open FILENAME (</path/to/$filename);
  open OUTFILENAME (>/path/to/$filename.new);
  while( <FILENAME>{
    s/<.*>//g #correct this - it is greedy
    print OUTFILENAME $_;
    }

This is ROUGH CODE

Ruben

In article <7et5vr$95n@news.service.uci.edu>,
	"Gabriel Richards" <grichard@uci.edu> writes:
> Is there a function which will allow me to delete text from a file? I want
> to delete all the tags in an HTML file just leaving the content.
> 
> Gabe
> 
> 


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

Date: 12 Apr 1999 17:18:07 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: I realy need some help...
Message-Id: <7et9sf$2ic$2@client2.news.psi.net>

eldorado@eudoramail.com (eldorado@eudoramail.com) wrote on MMXLVIII
September MCMXCIII in <URL:news:7eo3ra$trr$1@nnrp1.dejanews.com>:
[] I am very new to perl but willing...
[] 
[] I wanted to make a programm to test, within my web server, one after an
[] other, zillions of links in my site's database (text file with one record per
[] line) to weed-out dead links.
[] 
[] I can do it from my computer, but transferring the few MB database files back
[] and forth is not very easy.
[] 
[] After, I nearly crashed the server with my "home brew", I think it's time to
[] ask experts for help.
[] 


So, what exactly is your question?




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Mon, 12 Apr 1999 15:53:26 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: installing libnet on win32
Message-Id: <37121694.28670939@news.dircon.co.uk>

On Mon, 12 Apr 1999 11:28:18 -0400, "Tim Gray" <tgray@smlny.com>
wrote:

>I am having trouble getting libnet installed in an NT server.  I got a copy
>of microsoft's nmake.exe from visual studio.  When I run
>nmake test
>it gives me
>Net::SMTP: Uknown error at t\smtp.t line 15
>and then
>NMAKE: fatal error U1077: 'C:\perl\bin\perl.exe' : return code '0xff'
>
>I am using activestate build 514.  Thanks.
>

You are almost certanly better off using the Perl Package Manager
(PPM) that comes with the Activestate distribution.

Anyhow I thought that libnet came with that distribution. ?

/J\


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

Date: 12 Apr 1999 17:21:41 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <7eta35$2ic$3@client2.news.psi.net>

Poohba (poohba@io.com) wrote on MMXLVIII September MCMXCIII in
<URL:news:Pine.BSF.4.05.9904101039090.19025-100000@schultz.io.com>:
:: If so how?...I have a program that takes a little while to complete but i
:: don't want the user to abort so i would like something to be happening so
:: i thought maybe i could have ... appear as long as it is processing.  When
:: I say ... i mean the dots keep coming til program is complete.


unless ($pid = fork) {
    die "Could not fork\n" unless defined $pid;
    print "." while 1;
    exit;
}


# Your program here.


kill 9, $pid;
exit;



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Mon, 12 Apr 1999 17:21:16 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: is there any ceiling function in perl?
Message-Id: <7eta23$124$1@nnrp1.dejanews.com>

In article <MPG.117426cef9ca00d998984f@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
> In article <7edc1u$4hv$1@nnrp1.dejanews.com> on Tue, 06 Apr 1999
> 16:17:08 GMT, Don Roby <droby@copyright.com> says...
> ...
> > I also did a benchmark.  POSIX wins, which doesn't surprise me a bit, and
> > Larry's corrected version beats mine, which is also unsurprising.  I didn't
> > make and benchmark a corrected version of Samuel's, but I assume it would
work
> > out similarly to Larry's.  Multiplication by booleans is not efficient.
>
> The POSIX module calls the functions in the C library.
>
> Isn't the issue of perl performance here simply a matter of how many
> perl-ops it takes to implement the algorithm?  Fewer is better, which is
> why using the numeric value of a Boolean returned by the compiler (1 or
> 0)  should be best, rather than doing it explicitly by a '? 1 : 0'.
>

I don't think efficiency can be measured simply by counting operations in any
language.  Some operations are more expensive than others.

I agree that using these numeric values of Booleans is useful and may
sometimes be more efficient, as long as you stick to addition and
subtraction.

I think multiplication is a more complex process than addition or any of the
simple Boolean operations, so I would expect it to contribute a greater
inefficiency.

And in C and Perl of course, the evaluation of Boolean expressions can take
shortcuts.  Some shortcuts are possible in evaluating numerical expressions
(we all know what multiplication by 0 does after all), but are they actually
implemented?

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 12 Apr 1999 10:39:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Move from IIS, ASP, COM, Java to Linux, Apache, mod_perl, Java?
Message-Id: <37122FDB.31586141@mail.cor.epa.gov>

Steve Moon wrote:
> 
> Yeah, Perl probably would be better since it's all string processing. However
> the application is already written, and it would be a piece of work to re-write
> it/port it to Perl. I'm not sure what tn3270 modules are available for Perl
> either. As it stands we have a very nice object-oriented system that has worked
> very well in the real world.
> 
> Steve-
> 
> PS: Thanks for the reply!
> 
> >Check out JPL, the Java-Perl Library, free from O'Reilly.  Written by
> >Larry Wall, so you know it's awesome.  That should do what you want.
> >
> >But why are you using Java to do the connect to your back-end host?
> >That doesn't sound like you're playing to Java's strengths.  Perl might
> >be a better solution there too.  Or not - I have been wrong before.  :-)

Well, if it ain't broke, don't fix it.  Good luck.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Mon, 12 Apr 1999 11:00:47 -0700
From: mikej <mikej@1185design.com>
Subject: newbie question - blank form fields and selections
Message-Id: <371234CE.A588CC42@1185design.com>

Hey all,

I need to write a perl script that deals with form processing that does
things based on if the user left some fields in the form blank. I just
need to confirm the correct syntax for this. Tell me if this would work
if the user left the form field named "option1" blank, or did not select
anything if its a radio button selection:

$option1 = $my_form{'option1'};
 

if ($option1 eq "") {
 
do this;
 
}

else {

do that;

}

Are uninitialized fields just set as "" or is there some special way I
need to refer to them? Thanks!



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

Date: 12 Apr 1999 17:24:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: newbie to Perl
Message-Id: <7eta8c$2ic$4@client2.news.psi.net>

Jeff Thies (cyberjeff@sprintmail.com) wrote on MMXLIX September MCMXCIII
in <URL:news:3710BC76.34481D0@sprintmail.com>:
@@ > You might read up on @ARGV.
@@ 
@@ Got a good place to do that? As near as I can tell ARGV is passed on the
@@ query string and delimited by "+". Is that right?


No. Totally wrong.


Read perlvar.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Mon, 12 Apr 1999 17:45:43 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Re: Perl as a first programming language - suitability, good books ?
Message-Id: <923935136.24214.0.nnrp-12.c2de1237@news.demon.co.uk>

I'll let you know,

A friend has asked me to teach them Perl as their first programming
language.  I got her to buy Randal's Learning Perl for Win32.  I will simply
help them at each stage and write examples as required.

I think Perl wont be too difficult for anybody who is willing to work at it.
Besides, what other language could anyone suggest as a 'first language',
they are all a lot more difficult to the old BASIC a lot of us started with.

Tony



Peter L. Berghold <Peter@Berghold.Net> wrote in message
news:7uTP2.979$VC2.894@news.rdc1.nj.home.com...
> In article <7eg7c9$8ep$2@client2.news.psi.net>, abigail@fnx.com says...
> >
>
> >I wouldn't suggest Perl as a first language. Perl already proves to be
> >confusing enough for many people that do know other language.
> >
>
> Abigail!  You of all people surprise me with that answer!
>
> I have several people in my shop that are not programmers per se that are
doing
> just fine learning Perl as their first programming language.  If you
really
> want to learn a programming language it really doesn't matter which is
your
> first one...
>
>
> --
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> Peter L. Berghold                        Peter@Berghold.Net
> "Linux renders ships                     http://www.berghold.net
>  NT renders ships useless...."           ICQ# 11455958
>




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

Date: 12 Apr 1999 16:21:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Development Environment
Message-Id: <7et6hs$1un$1@client2.news.psi.net>

JDDemme (jddemme@technologist.com) wrote on MMXLIX September MCMXCIII in
<URL:news:7eqkcj$lf5$2@bgtnsc02.worldnet.att.net>:
// Does a good perl dev environment exist?
// For linux?
// 
// I'm sick of going to Elvis(vi) then out and typing ./XXXXX!!!! then back to 
// elvis, and out to command line.


Djeez. Write a macro.

>From my .vilerc:

19 store-macro
   save-file
   shell-command &cat "/opt/perl/bin/perl -c " $cfilname
~endm
bind-key execute-macro-19 M-p
bind-key execute-macro-19 ^A-p

18 store-macro
   save-file
   shell-command &cat "/opt/perl/bin/perl -w " $cfilname
~endm
bind-key execute-macro-18 M-r
bind-key execute-macro-18 ^A-r



I would be very surprised elvis doesn't have macro capability.




Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: 12 Apr 1999 17:09:06 GMT
From: ruben@llinderman.dental.nyu.edu (Sys Adm 89806 Manager of programing development and Intranet Resources)
Subject: Re: Perl Development Environment
Message-Id: <7et9bi$9b1$2@news.nyu.edu>

A good enviorment is in gvim or vi improved.

Ruben



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

Date: 12 Apr 1999 17:26:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl or C?
Message-Id: <7etabj$2ic$5@client2.news.psi.net>

airplanes@altavista.net (airplanes@altavista.net) wrote on MMXLIX
September MCMXCIII in <URL:news:7eq805$glc$1@nnrp1.dejanews.com>:
@@ Hello,
@@     Which is a better language to lean - C or Perl???


Define better.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Mon, 12 Apr 1999 15:58:33 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Reading piped Data from STDIN on NT
Message-Id: <ebohlmanFA331M.FI9@netcom.com>

lingane@my-dejanews.com wrote:
: With this loop it will read data typed in after the script is invoked, but
: I have been unable to make it read data piped in.

: What is wrong with

: dir c:/* | myscript.pl

On NT, a program invoked through file associations can't use IO 
redirection (don't ask me why).  Change 'myscript.pl' to 'perl 
myscript.pl' or use perl2bat to create myscript.bat.



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

Date: 12 Apr 1999 10:01:00 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: RTFM please!  perldoc PSI::ESP (was Re: Validating Email addresses)
Message-Id: <xkfpv59ltfn.fsf@valdemar.col.hp.com>

"Matthew O. Persico" <mpersico@erols.com> writes:
> Hey, here's a thought: Maybe the PSI:: family could be the basis for
> the kernel of the DWIM machine! 

I don't think it would work.  DWIM would just collapse under the
pressure.

-=Eric


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

Date: 12 Apr 1999 17:45:05 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: RTFM please!  perldoc PSI::ESP (was Re: Validating Email addresses)
Message-Id: <slrn7h4cdu.e7i.fl_aggie@stat.fsu.edu>

On 12 Apr 1999 10:01:00 -0600, Eric The Read
<emschwar@rmi.net>, in <xkfpv59ltfn.fsf@valdemar.col.hp.com> wrote:

+ I don't think it would work.  DWIM would just collapse under the
+ pressure.

Nah, it would just become a BOFH.

James


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

Date: 12 Apr 1999 17:23:56 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: SORT BY DATE
Message-Id: <7eta7c$d4h$1@pegasus.csx.cam.ac.uk>

Larry Rosler <lr@hpl.hp.com> wrote:
>
>As the gmtime() function seems to clip the largest negative argument to 
>the integer -(2 ** 31), the earliest value the Unix implementations 
>return is Fri Dec 13 20:45:52 1901.  This is greater than 1900, so your 
>question is moot.

That may be true on your platform, but in general the range of valid
arguments to gmtime() is platform-dependent.    Some only allow
0..2**31-1, so no dates before 1970 are handled.    And others (64 bit
systems) may handle dates back to well before the start of the Gregorian
calendar.     I don't have one to play with myself, but I certainly
hope they return the correct (year-1900) value for dates before 1900.


Mike Guy


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5361
**************************************

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