[11516] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5116 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 12 05:07:34 1999

Date: Fri, 12 Mar 99 02:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 12 Mar 1999     Volume: 8 Number: 5116

Today's topics:
    Re: 
    Re: 
    Re: 
    Re: 1000 thread limit? <byron@thrush.omix.com>
        About Mail List <erics@asiacd.com>
    Re: BigInt: Decimal to Hex (Ilya Zakharevich)
    Re: Can I turn a Perl program into an NT .exe? <green@networktel.net>
        CGI Images <raj@nyct.net>
    Re: CGI Images <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: CGI.pm - parameter count? <Philip.Newton@datenrevision.de>
    Re: Complex Structure Question (Larry Rosler)
    Re: debugger mystery... (Ilya Zakharevich)
    Re: Elegant remote execution of Perl-scripts? pault12@postoffice.pacbell.net
    Re: interpolating package name into require statement <rick.delaney@home.com>
    Re: MS ACCESS database with perl <green@networktel.net>
    Re: Newbie Perl for NT question (Mark Scherf)
    Re: Objects: overriding a constructor <H.van.der.Breggen@opleidingen.capgemini.nl>
        Package usage <admin@asarian-host.org>
        Package Usage <admin@asarian-host.org>
        Perlscript in Active Server pages <_johan_@farleden.com>
    Re: print << "(END)" ? <ekkis@arix.com>
    Re: Printing in Perl (Bart Lateur)
    Re: Printing with object references <ebohlman@netcom.com>
    Re: Quick way to get Perl for Win32 <azizimj@yahoo.com>
        regexp gurus help! Parsing HTML mct@moviefone.com
    Re: regexp gurus help! Parsing HTML (Bart Lateur)
        remote ftp and exec from NT to Unix <raming@ewh.uni-hannover.de>
    Re: The truth about the Pentium III chip and ID --- **b <johnl@axis.com.au>
    Re: write/format bypasses tie? <rick.delaney@home.com>
    Re: write/format bypasses tie? (Sean McAfee)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 11 Mar 1999 23:49:40 -0500
From: in@after.noon (Friday@Dragnet)
Subject: Re: 
Message-Id: <in-1103992349410001@1cust223.tnt6.syracuse.ny.da.uu.net>

In article <MPG.1151cdc41a82b7d989722@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:

> The real problem is here.  You tried to change the value of the
temporary variable $file 
> (and wouldn't succeed, because the right-hand side is a string, not a 
> substitution operator), but that wouldn't change the name of the file in 
> the file system, would it?  You need to ask the OS to do that.
> 
> Something like the following:
> 
>   if ($file =~ /(.*)\.html$/) {
>      rename $dir/$file, $dir/$1
>          or die "Couldn't rename $dir/$file. $!\n";
>   }
> 
> > }

Thanks Larry!

This did the trick:

###############################
#!/usr/bin/perl -w
use strict;
my $dir = '/home/gigs/public_html/bbs';
opendir (BBS, $dir) or die "Couldn't open $dir. $!\n";
foreach my $file (readdir BBS) {
   if ($file =~ /(.*)\.html$/) {
   rename ("$dir/$file" , "$dir/$1") or die "Couldn't rename $dir/$file. $!\n";
   }
}
##########################################


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

Date: Thu, 11 Mar 1999 23:51:14 -0500
From: in@after.noon (Friday@Dragnet)
Subject: Re: 
Message-Id: <in-1103992351150001@1cust223.tnt6.syracuse.ny.da.uu.net>

In article <gd99c7.379.ln@magna.metronet.com>, tadmc@metronet.com (Tad
McClellan) wrote:


>    1) you have not enabled warnings
>    2) you have not invoked the 'use strict' pragma (compiler directive)
>    3) you have not checked the return value from your opendir() call
>    4) you have changed your pattern match into a string by enclosing
>       it in quotes (this is the "biggie")
>    5) you haven't anchored your pattern match to the end of the string
>    6) you never actually move the file to the new filename
>    7) you should closedir() when you are done with it

<snip good examples>

Thanks for the great tips tad. I finally got it working.

Bob


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

Date: Thu, 11 Mar 1999 15:53:30 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 
Message-Id: <MPG.1151f754c0b05fab989727@nntp.hpl.hp.com>

In article <36E84DC8.9D3E7A4C@idt.net> on Thu, 11 Mar 1999 18:12:08 -
0500, James Tolley <jamesht@idt.net> says...
> This works for me:
 ... 
> It compiled, and ran fine for me as it is above, but it doesn't do anything.

Too funny!  It 'works', but it doesn't do anything.  Indeed.  That's the 
problem, isn't it?

But I posted a solution, about two hours ago.

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Mar 1999 07:57:02 GMT
From: Byron Brummer <byron@thrush.omix.com>
Subject: Re: 1000 thread limit?
Message-Id: <921225682.778983@thrush.omix.com>

archon16@my-dejanews.com wrote:
: I'm playing with the Thread module...  and I was dismayed to discover a limit
: of about 1000 threads allowed at a time (on my machine, at least.)  After
: hitting this limit, the program simply dumps core.  Does anyone know of a way
: to get around this limitation?	(Without recompiling the Linux kernel, that
: is.)  I really, really need to have about 30,000 simultaneous threads. 
: (Don't ask.  I just do. ;-)

	Hmm, you might want to ask the Linux groups about this.  I'm not
	sure how Linux handles threads, but I don't think perl has much
	control over it.

	Linux BTW, really doesn't handle that much context switching well at
	all. -This is one of the reasons many prefer FreeBSD for heavily
	loaded server use.

	Regardless of the system however, I would *highly* question the need
	for 30k threads for any single application what so ever (short of a
	"crashme" utility).  You must have been talking to too many Java
	folks (two threads per non-blocking IO stream my arse!).

	It sounds to me like you need to study up on resource pooling and
	proper use of things like select().  What in blazes are you trying
	to do anyway?

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Fri, 12 Mar 1999 17:32:32 +0800
From: Eric Sze <erics@asiacd.com>
Subject: About Mail List
Message-Id: <36E8DF2F.5395597F@asiacd.com>

Hi Guys, I am new in here so pls help me with this problem.
I am planning to write a program that can update my email address
database once I have receive a email address from the client side.

I have try to write it by myself for awhile but still cannot figure it
out how to do it...?? Could anyone kindly tell me where can I find these
kind of scripts.

Many thanks.



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

Date: 12 Mar 1999 08:14:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: BigInt: Decimal to Hex
Message-Id: <7caico$bm1$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Mark Rafn 
<dagon@halcyon.com>],
who wrote in article <7c9200$7q1$1@halcyon.com>:
> >Why should they?  If you do not use 
> >    $a % $b
> >then you know what you do.  An overhead of creating a new object may
> >be prohibitive.
> 
> They should be because of exactly what we're doing.  We want to call a
> BigInt method on a number and than a BigInt method on the result.

I do not understand how what you want to do may affect behaviour of
any module.

> Also, perldoc Math::BigInt sez
>    $i->bdiv(BINT) return (BINT,BINT)  division (quo,rem) just quo if scalar
> indicating that the return values should be BigInt as well.

For me it clearly indicates that the return value is BINT.  Where did
you get that impression that the return values is BigInt?

Let me state it again for those who did not grasp it yet: the only
purpose why Math/BigInt.pm exists is a possibility to check that
overloading works.  If you want something else, use some better
alternative.

Math::BigInt is lousy, not actively supported, etc etc.

Ilya


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

Date: Fri, 12 Mar 1999 00:27:44 -0600
From: "Eric" <green@networktel.net>
Subject: Re: Can I turn a Perl program into an NT .exe?
Message-Id: <36e8b537.0@news.networktel.net>

I think the Perl2Exe does not create true standalone exes.  That version may
be released in the PDK (Perl Development Kit).  The current Perl2Exe
requires perl to be installed on the computer running the exe -- doesnt make
much since!  I think their reasoning was creating exes for cgi.  If I am
incorrect somebody please post some new info because I have been wanting to
compile true perl standalones.

Eric Greenwood


hal 9000 wrote in message <36E636A7.5DF342AB@fetchmail.com>...
>Perl2Exe at <http://www.demobuilder.com/perl2exe.htm> looks
>as what you are after. I have not yet tried it myself
>though...
>
>leonandrews@my-dejanews.com wrote:
>>
>> Hi,
>>
>> Can anyone point me towards some documentation on compiling perl programs
on
>> NT into standalone executables? I'm using ActivePerl 509 on NT4.
>>
>> many thanks,
>>
>> Leon.
>>
>> -----------== Posted via Deja News, The Discussion Network ==----------
>> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>
>--
>~hal9000




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

Date: Fri, 12 Mar 1999 01:16:27 GMT
From: Rajan Alexander <raj@nyct.net>
Subject: CGI Images
Message-Id: <36E86AEB.35B1@nyct.net>

I saw a CGI based database which allowed the upload of local images to
the site.  Does anyone know how this is accomplished or where I may
obtain more information?

-- 
Rajan Alexander


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

Date: 12 Mar 1999 09:46:42 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: CGI Images
Message-Id: <83yal39jt9.fsf@vcpc.univie.ac.at>

Re: CGI Images, Rajan <raj@nyct.net> said:

Rajan> I saw a CGI based database which allowed the
Rajan> upload of local images to the site.  Does
Rajan> anyone know how this is accomplished or where
Rajan> I may obtain more information?

And this has what, exactly, to do with perl?

If you want to ask CGI questions, use a CGI
newsgroup:

    news:comp.infosystems.www.authoring.cgi

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Fri, 12 Mar 1999 10:23:16 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: CGI.pm - parameter count?
Message-Id: <36E8DD04.A226B90B@datenrevision.de>

k_mcdermott@my-dejanews.com wrote:
> 
> I had thought that the number of parameters would be useful since the creator,
> only has one parameter and the form processor has many, but I can't get
> the number of parameters out?

Well, you said above that you are using CGI.pm -- a quick look at its
documentation shows that there is a method param, which you can call
either as $query->param or just as param (depending on whether you're
using the object-oriented or functional interface). This gives you a
list with the names of the parameters. If you take this in scalar
context, it gives you the number of parameters.

Example:

    @names = $query->param;
    $numparams = @names;

(Possibly this also works:

    $numparams = scalar $query->param;

It depends on whether param gives something else back depending on 
whether it was called in scalar or list context.)

Cheers,
Philip


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

Date: Thu, 11 Mar 1999 14:20:54 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Complex Structure Question
Message-Id: <MPG.1151e1a68e8f943e989726@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36E81DB4.AADC9F29@interaccess.com> on Thu, 11 Mar 1999 
15:47:01 -0500, Bruce Hodo <bruceh@interaccess.com> says...
> The Sixty-Four Dollar Question is: Isn't saving the reference basically saving
> the location (reference), and not the values of the array? The reason I didn't
> do that is because I resuse some of the arrays. I want to save the original
> values so I can recall them latter. It was my impression that dereferencing
> them would get me the last values stored, not the ones I wanted.

The $0.02 answer is:  You are right, to some degree.  Saving a reference 
to an array gives you access to the current contents of the array.  
However, if the array is declared by a 'my' variable in a loop, new 
storage is allocated for each reference.  Alternatively, one can copy an 
array into an anonymous array (as in the *comments* in the examples 
below), and store a reference to that.

> Ala Qumsieh wrote:
 ...
> > $data{$gate} = \@dests;                 # or = [@dests];
> > $data{$gate}{$dest} = \@areas;          # or = [@areas];
> >
> > Then, to access those arrays back, you need to dereference them:
> >
> > @dests = @{$data{$gate}};
> > @areas = @{$data{$gate}{$dest}};

There is great confusion here.  The keys of %data are set up by the 
first store above to be references to arrays.  The second store then 
treats them as references to hashes.  The compiler complains "Can't 
coerce array into hash at ...".

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Mar 1999 08:19:41 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: debugger mystery...
Message-Id: <7caimt$bo1$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Matthew O. Persico
<mpersico@bestweb.net>],
who wrote in article <36E87D71.E01252A8@bestweb.net>:
> > > The debugger displays some of my code out of order. It also seems to
> > > skip over some while loops.

> This mostly happens with loops. You hit the loop top and the next step
> takes you to the first executable line past the loop bottom. It's
> annoying, but it is not harmful. If you really have a problem with it,
> report it as a bug. The docs that come with perl tell you how. Try
> perldoc perlbug.

But only if you are running a new enough perl.  I *hope* that all
these bugs should be corrected for 5.005.

Ilya


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

Date: Thu, 11 Mar 1999 21:58:05 -0800
From: pault12@postoffice.pacbell.net
Subject: Re: Elegant remote execution of Perl-scripts?
Message-Id: <36E8ACED.2B7DFDE6@postoffice.pacbell.net>



G.B. Woeste wrote:

> Hi,
>
> two questions:
>
> how can I execute a Perl-script, which is initially located on
> computer A on another computer B?
>
> How can I transmit values from computer A as commman-line arguments to a
> (then executed) Perl-script on computer B?
>
> Both computers are working under Unix and are connected (via TCP/IP).
>
> The problem for me is, that I don't know much about Networking , Sockets
> and so on.
>
> Does anyone have some example code? That would be very helpfull!
>
> Thank you!
>
> Regards,
>
> Georg Woeste

Perl Application Server does exactly
what you want ( + more ). Download Build2 or  look at
pas.pl Pas.pm ( also avilable online for browsing ).

http://www.pault.com

--

 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   Email: paul@qub.com     o Perl Application Server
   http:  www.pault.com    o XML Tube
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




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

Date: Fri, 12 Mar 1999 04:39:35 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: interpolating package name into require statement
Message-Id: <36E89C7B.F7BE1462@home.com>

[posted & mailed]

Phil R Lawrence wrote:
> 
> I want to do this:
> 
> my $package_name = 'ding';
> require $package_name;
> 
> It chokes, presumably because it is looking for a text file named 
> 'ding', instead of a module named ding.pm.  Any ideas on how I can do 
> this sort of thing? 

There's alway eval:

    eval qq{ require $package_name };

or if you don't need indirect object notation, then why not us the
actual file name?

    require "$package_name.pm";

You'd also have to replace any '::' with your directory separator in
this case.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 12 Mar 1999 00:32:50 -0600
From: "Eric" <green@networktel.net>
Subject: Re: MS ACCESS database with perl
Message-Id: <36e8b668.0@news.networktel.net>

You also could use the OLE module with an ADO connection.  It works pretty
good.

Eric Greenwood
green@networktel.net

leonandrews@my-dejanews.com wrote in message
<7c4ld4$j6p$1@nnrp1.dejanews.com>...
>It's easy, so long as you are reasonably proficient with Perl and can get
to
>grips with some documentation.
>
>You need ActivePerl 509 from http://www.activestate.com
>
>install DBD-ODBC and DBI using the ppm installer supplied with ActivePerl,
>set up an ODBC system DSN in control panel, and away you go.
>
>In fact, that's exactly what I did this morning, and it works very well.
Give
>me a shout if you want more help,
>
>Leon.
>
>
>In article <7c0k8o$rjc$1@xenon.inbe.net>,
>  "Nicolas Malfeyt" <nicolasm@luon.be> wrote:
>> Is it possible and how hard would it be to send some kind of SQL query to
an
>> MS ACCESS database residing on your webserver with Perl, and then using
the
>> results in your web application?
>>
>> Thanks,
>>
>> Nicolas Malfeyt
>> nicolasm@luon.com
>>
>>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: Fri, 12 Mar 1999 08:02:15 GMT
From: mscherf@bigpond.com (Mark Scherf)
Subject: Re: Newbie Perl for NT question
Message-Id: <36e8c9d2.651899@news.bigpond.com>

I followed these instructions and it didn't work
I found that the %s %s should read "%s" "%s"


Mark

On Thu, 11 Mar 1999 23:24:19 +0100, "CMB" <ceeembee@nlsport.com>
wrote:

>Hai,
>
>here is some text to configure IIS
>
>To configure PERL script mapping
>
>WARNING: Using Registry Editor incorrectly can cause serious, system-wide
>problems that may require you to reinstall Windows NT to correct them.
>Microsoft cannot guarantee that any problems resulting from the use of
>Registry Editor can be solved. Use this tool at your own risk.
>
>
>
>1.Start Regedt32.exe and open the following registry key:
>
>
>
>
>
>      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
>      \Parameters\ScriptMap
>
>
>
>
>
>2.Click Add Value from the Edit menu.
>
>3.The Value Name is .pl
>
>4.The Data type is REG_SZ.
>
>5.The String value is <the full path to perl.exe>\perl.exe %s %s
>
>NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).
>
>6.Restart the WWW service.
>
>
>
>Now that the registry has been configured, you can test the PERL script with
>your browser. Using the defaults directory structure with IIS, the URL would
>be the following:
>
>
>
>   http://<Server Name>/scripts/helloworld.pl?
>
>
>I'm not sure anymore if this is all you had to do, but it is a start.
>
>I got these info from the web somewere, so if it is not enough, it's out
>there
>.
>Goodluck
>
>Ron Warlich
>
>
>
>Mike Begeman heeft geschreven in bericht <36e2e889.0@news.glasscity.net>...
>>I installed Perl on our NT server (IIS3).  When I click on link in IE or
>>Netscape that is supposed to run a perl script, it brings up the dialog for
>>downloading the file (testperl.pl).  Is there something I have to do to
>IIS3
>>to get it to run the script?
>>
>>Mike Begeman
>>
>>
>
>



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

Date: Fri, 12 Mar 1999 09:53:31 +0100
From: Herald van der Breggen <H.van.der.Breggen@opleidingen.capgemini.nl>
Subject: Re: Objects: overriding a constructor
Message-Id: <36E8D60B.7308F1D0@opleidingen.capgemini.nl>

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

Thanks !
Indeed this works ! and this is a nice way to achieve overriding

Herald

Damian Conway wrote:

> Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> writes:
>
> >    package B;
> >    @ISA = qw(A);                                # B extends A
> >    sub new {
> >        my ($class, $a, $b) = @_;
> >        my $self = bless $class->SUPER::new($a), $class;     # super(a)
>
> my $self = $class->SUPER::new($a);      # No need to rebless since A::new
>                                         # uses the two-argument bless.
>
> >        $self->{b} = $b;
> >        $self;
> >    }
>
> Damian

--------------540F1E5C61F8299318817755
Content-Type: text/x-vcard; charset=us-ascii;
 name="H.van.der.Breggen.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Herald van der Breggen
Content-Disposition: attachment;
 filename="H.van.der.Breggen.vcf"

begin:vcard 
n:van der Breggen;Herald
x-mozilla-html:TRUE
org:Cap Gemini
version:2.1
email;internet:H.van.der.Breggen@opleidingen.capgemini.nl
title:ir.
tel;fax:+31 (0) 30 252 6626
tel;home:+31 (0) 33 4321053
tel;work:+31 (0) 30 252 7521
note:http://opleidingen.capgemini.nl
adr;quoted-printable:;;Daltonlaan 500=0D=0AP.O. Box 2575;Utrecht;Utrecht;3500 GN;Netherlands
x-mozilla-cpt:;0
fn:Herald van der Breggen
end:vcard

--------------540F1E5C61F8299318817755--



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

Date: Fri, 12 Mar 1999 09:05:50 GMT
From: Mark <admin@asarian-host.org>
Subject: Package usage
Message-Id: <7cald9$s1d$1@nnrp1.dejanews.com>

Hi,

I am trying to use a module:

use Net::SMTP;
use strict;

I put these lines at the tp of my program, but perl always complains with the
message that the global variable SMTP needs explicit reference to a package.
Then it aborts. Sigh. Do I need to include some sort of extra reference to the
package in my program? Sorry to sound so ignorant, but I am new to this
packages thingy.

P.S. If you reply, can you please cc a copy to my email-address? my news
server is kinda flaky.

Any help would be grearly appreciated,

- Mark

        System Administrator Asarian-host.org

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


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

Date: Fri, 12 Mar 1999 10:18:41 +0100
From: Mark <admin@asarian-host.org>
Subject: Package Usage
Message-Id: <199903120920.CAA27004@asarian-host.org>

Hi,

I am trying to use a module:

use Net::SMTP;
use strict;

I put these lines at the tp of my program, but perl always complains with
the message that the global variable SMTP needs explicit reference to a
package. Then it aborts. Sigh. Do I need to include some sort of extra
reference to the package in my program? Sorry to sound so ignorant, but I am
new to this packages thingy.

P.S. If you reply, can you please cc a copy to my email-address? my news
server is kinda flaky.

Any help would be grearly appreciated,

- Mark

        System Administrator Asarian-host.org





--
For more information about this posting service, contact:

help@asarian-host.org      -- for info about our services
admin@asarian-host.org     -- for the server's administrator
nclark@asarian-host.org    -- for our PR manager
irchelper@asarian-host.org -- for help on irc matters

If you want an anonymous account, visit our sign-up page:

http://asarian-host.org/emailform.html


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

Date: Fri, 12 Mar 1999 09:34:37 +0200
From: johan <_johan_@farleden.com>
Subject: Perlscript in Active Server pages
Message-Id: <36E8C38C.C3FFD706@_farleden.com>

Have been trying to use the printf-function in asp-pages, but it simply
won't work, works fine in cgi-script but not in ASP.... in ASP it
returns the number of objects instead of a formatted output:
printf "integer %d",55; #returns '2' instead of 'integer 55'

any ideas???

(remove the underscores from my mailadress, don't want to get spammed...
:-| )



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

Date: Thu, 11 Mar 1999 18:23:54 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: print << "(END)" ?
Message-Id: <IU_F2.4909$TD3.54119@typhoon-sf.pbi.net>

Ketan Patel wrote in message
<36E01C41.E628C9A0@BLAHNOSPAMBLAHxwebdesign.com>...
>print << "(END)";
><img src="blah" height="10" width="10">
>(END)
>
>Is there a one line answer?  Does it have something to do with 'qw'?


what wrong with this?
print '<img src="blah" height="10" width="10">';

or this?
print "<img src='blah' height='10' width='10'>";





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

Date: Fri, 12 Mar 1999 09:12:24 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Printing in Perl
Message-Id: <36e9d2bb.3987994@news.skynet.be>

Eric Bohlman wrote:

>Fixed-width fonts are certainly less readable than variable-width fonts 
>for *prose*.  But Perl's report facilities were never intended for 
>producing prose.  They were intended for producing tabular material, 
>where different readability considerations apply.

When a (potential) client's original data is fixed column width,
formatted with spaces, I dare use a fixed pitch font for a quick demo.
But even then, people complain about it.

It's ugly. It's primitive. It's amateuristic.

Fixed pitch fonts compare to variable pitch fonts pretty much like a
real, human voice compares to a "computer" voice. You notice the
difference in appeal *instantly*.

I wouldn't use fixed pitch tabular data for anything else than for
debugging, where a quick fix is far more important than long lasting
appeal.

	Bart.
-- 
	"Divide By Cucumber Error"
			-- Terry Pratchett in the "Discworld" series


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

Date: Fri, 12 Mar 1999 09:02:10 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Printing with object references
Message-Id: <ebohlmanF8H53M.J0@netcom.com>

matthew_keene@my-dejanews.com wrote:
: I'm confused about using object data methods in a print statement.  If I use:

:   print "Error received: $res->code\n"

: then Perl prints out:

:   Error received: HTTP::Response=HASH(0x1117a28)->code

: If I use

:   print "Error received: ", $res->code, "\n" ;

: then everything prints as expected, ie:

:   Error received: 407

: In my limited understanding I think that the first example evaluates the
: variable $res in a scalar context rather than as an object, but I'm not
: entirely sure why.  Is there any way I could have coded the first type of
: statement and had Perl resolve the reference to the object method correctly ?

Not really.  A method call is really just a special kind of subroutine 
call, and Perl doesn't interpolate subroutine calls in quoted strings.  
You might want to look at "How do I expand function calls in strings?" in 
perlfaq4; as you'll read there, doing so is regarded by many people as 
unnecessarily tricky.



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

Date: Fri, 12 Mar 1999 11:59:22 +0800
From: Azizi Mohamed Jennis <azizimj@yahoo.com>
Subject: Re: Quick way to get Perl for Win32
Message-Id: <36E8911A.6175@yahoo.com>

Eytan Seidman wrote:
> 
> Can anyone recommend the quickest and best way to get Perl for Win32 without
> having a C/C++ compiler.  Details would be appreciated,
> 
> Eytan

Go to http://www.activestate.com and download the interpreter. You don't
need
a C/C++ compiler.


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

Date: Fri, 12 Mar 1999 06:28:28 GMT
From: mct@moviefone.com
Subject: regexp gurus help! Parsing HTML
Message-Id: <7cac66$jp5$1@nnrp1.dejanews.com>

I've killed two perfectly good evenings trying to do this:

Take this string:

<INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed">

Chop off the angle brackets. Did this, no problem.

INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed"

Split the elements so that I can store them in an array. Like this;

INPUT
TYPE="checkbox"
NAME="NotListed"
VALUE="Not Listed"

I've tried:

$line = "<INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed">"
@attributes = split (/\s/, $line);

Everything is fine except for the what should be the last element ends up as
two:

VALUE="Not
Listed"

This, I know, is because I'm matching the white space. The problem is, no
matter how I try to do it, I can't figure it out.


Please, deliver me from my mental block! Thank You!

Matt Trimboli
mct@moviefone.com

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


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

Date: Fri, 12 Mar 1999 09:12:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regexp gurus help! Parsing HTML
Message-Id: <36ebd8a0.5491181@news.skynet.be>

mct@moviefone.com wrote:

>I've killed two perfectly good evenings trying to do this:
>
>Take this string:
>
><INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed">

Good example of what split() is bad in. You should use a real parser, or
a better quick fix. Here's a (rather succesful :-) attempt.

Note that the //g modifier is necessary to be able to use pos() in a
meaningful way.

  #! perl -w
  $_ = qq{<INPUT TYPE="checkbox" NAME="NotListed" VALUE="Not Listed">
  rest...}; #Originally there was no newline in ths line
  if (/<(INPUT)\s+/gi) {
	print STDERR "Found $1 \n";
	%attribute = map { split /\s*=\s*/,$_,2 }
	   /(\w+)\s*=\s*("[^"]*"|[\w.-]+)/gc;
	foreach (keys %attribute) {
		$attribute{$_} =~  s/^"(.*)"/$1/;
	}
	/>/gc;
	substr ($_, 0, pos) = "";
  }

  print STDERR "Main string: $_\n";
  foreach (sort keys %attribute) {
	print STDERR "$_ => $attribute{$_}\n";
  }
__END__
Found INPUT
Main string: rest...
NAME => NotListed
TYPE => checkbox
VALUE => Not Listed

	Bart.


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

Date: Fri, 12 Mar 1999 10:20:23 +0100
From: Georg Raming <raming@ewh.uni-hannover.de>
Subject: remote ftp and exec from NT to Unix
Message-Id: <36E8DC57.D9717D7F@ewh.uni-hannover.de>

Hi everybody!

Can anyone please give me a quick example how to transfer files from
NT-Workstation to a Unix-Workstation and execute a command there via a
perl script on NT-Perl5.0?

Thanks in advance!


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

Date: Fri, 12 Mar 1999 04:55:16 GMT
From: John Lehmann <johnl@axis.com.au>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36E89D8F.108534A9@axis.com.au>

Kano wrote:
> 
> Oh come on. Many other standard devices (ethernet cards, for example)
> have their
> own unique serial numbers that software can use at will. Get over it.
> 

Yes - but ethernet mac cards are only broadcast over the lan, not over
the net (except by Office98, of course).  And what do you mean get over
it???  This kind of personal information is valuable.  Business are
willing to pay for it.  This kind of behavior IS DOWNRIGHT THEFT!!!  And
I take offence at that, as should you and any other good capitalist.

-- 
| John J. Lehmann, johnl@axis.com.au
+ Those were the good old days when you could get hammered and ramble
+ all night to the guy next to you, knowing that he really didn't give a
+ crap but he'd sit there and listen.


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

Date: Fri, 12 Mar 1999 04:12:46 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: write/format bypasses tie?
Message-Id: <36E8962C.A087C809@home.com>

[posted & mailed]

Sean McAfee wrote:
> 
> ----------------------------------------------------------------------
> use IO::Scalar;
> 
> # tie *STDOUT, 'IO::Scalar', \$x;
> print "Testing, testing...\n";
> write;
> 
> format STDOUT =
> 1, 2, 3
> .
> ----------------------------------------------------------------------
> 
> When I run this code, I get two lines: "Testing, testing..." and "1, 2, 3".
> If I uncomment the "tie" line, though, the "Testing, testing..." line goes
> into $x, but I still get "1, 2, 3" on my terminal.
> 
> Is this a bug, or am I missing something totally obvious?  (I'm using Perl
> 5.005_02, btw.)

I hate to ask the obvious, but does IO::Scalar define a WRITE method?  I
don't have this module but I just had a quick peek at it on CPAN and
didn't see one defined in Scalar.pm.

I didn't check the inheritance tree though.  I think Tom's pmtools would
be a good way to find out if a WRITE method is defined or not.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 12 Mar 1999 05:47:08 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: write/format bypasses tie?
Message-Id: <wT1G2.11129$Ge3.43906617@news.itd.umich.edu>

In article <36E8962C.A087C809@home.com>,
Rick Delaney  <rick.delaney@home.com> wrote:
>[posted & mailed]
>Sean McAfee wrote:
>> ----------------------------------------------------------------------
>> use IO::Scalar;
>> 
>> # tie *STDOUT, 'IO::Scalar', \$x;
>> print "Testing, testing...\n";
>> write;
>> 
>> format STDOUT =
>> 1, 2, 3
>> .
>> ----------------------------------------------------------------------

>I hate to ask the obvious, but does IO::Scalar define a WRITE method?  I
>don't have this module but I just had a quick peek at it on CPAN and
>didn't see one defined in Scalar.pm.

>I didn't check the inheritance tree though.  I think Tom's pmtools would
>be a good way to find out if a WRITE method is defined or not.

I added a line 'syswrite(STDOUT, "foo", 3);' to my program above, and got
this error message:

Can't locate object method "WRITE" via package "IO::Scalar" at pp line 4.

This surprises me.  I'd have thought that an official CPAN tied filehandle
module would provide a complete tied filehandle implementation...

Anyway, it doesn't solve my problem.  I wrote a quick-n-dirty replacement
for IO::Scalar, including a WRITE method, and the "format" output still
went to my terminal.

The reason I wanted to capture write/format output was to send a number of
reports as attachments using MIME::Lite.  Since my original approach
didn't seem to work, I changed course and just printed to a number of
temporary files.  I suppose it's debatable which method is less awkward.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

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

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