[23309] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5529 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 19 14:10:53 2003

Date: Fri, 19 Sep 2003 11:10:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 19 Sep 2003     Volume: 10 Number: 5529

Today's topics:
        set a default for @INC <samj@austarmetro.com.au>
    Re: set a default for @INC <ak+usenet@freeshell.org>
    Re: set a default for @INC <grazz@pobox.com>
        simple server <no.name@eidosnet.co.uk>
    Re: simple server (Tad McClellan)
    Re: simple server <no.name@eidosnet.co.uk>
        Writing out part of a file <nospam@goawayspam.com>
    Re: Writing out part of a file <glex_nospam@qwest.net>
    Re: Writing out part of a file (Tad McClellan)
    Re: wtf is the deal? <jurgenex@hotmail.com>
    Re: wtf is the deal? (Tad McClellan)
    Re: wtf is the deal? <emschwar@pobox.com>
    Re: WWW::Mechanize click() returns "Unexpected field va (Chris Marshall)
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Sep 2003 16:34:46 GMT
From: Sam <samj@austarmetro.com.au>
Subject: set a default for @INC
Message-Id: <3F6B31E3.2070803@austarmetro.com.au>

Hello
can I set a list of default locations to always be in the @INC so that I 
don't have to add the line use lib "location" in my programs?
if so, then how?

thanks



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

Date: Fri, 19 Sep 2003 16:39:43 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: set a default for @INC
Message-Id: <slrnbmmcac.lmd.ak+usenet@vinland.freeshell.org>

In article <3F6B31E3.2070803@austarmetro.com.au>, Sam wrote:
> Hello
> can I set a list of default locations to always be in the @INC so that I 
> don't have to add the line use lib "location" in my programs?
> if so, then how?

Set the PERLLIB or PERL5LIB environment variables to the
':'-separated list of directories you want to use.  PERL5LIB
overrules PERLLIB.  This is assuming a Unix-type system.


-- 
Andreas Kähäri


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

Date: Fri, 19 Sep 2003 16:40:25 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: set a default for @INC
Message-Id: <ZjGab.897$Uv2.150@nwrdny02.gnilink.net>

Sam <samj@austarmetro.com.au> wrote:
> can I set a list of default locations to always be in the @INC 
> so that I don't have to add the line use lib "location" in my 
> programs?

Check the FAQ:

  $ perldoc -q runtime

You can also reconfigure perl defining PERL_OTHERLIBDIRS.

-- 
Steve


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

Date: Fri, 19 Sep 2003 14:52:39 +0000 (UTC)
From: "D Borland" <no.name@eidosnet.co.uk>
Subject: simple server
Message-Id: <bkf57n$gb7$1@sparta.btinternet.com>

Hi,

I am looking to create database (probably) using SQLlite and perl and it's
interface.  What i would like to know is there any way with perl for me to
create a simple server, so i could say open a local file form the harddrive
in my webbrowser, then click on a link to execute a perl script which will
in turn return data to the current browser process.

Hope i explained that ok.

With Thanks

D Borland


---
This e-mail has been virus scanned and is certified virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/03




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

Date: Fri, 19 Sep 2003 10:06:10 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: simple server
Message-Id: <slrnbmm6r2.gdh.tadmc@magna.augustmail.com>

D Borland <no.name@eidosnet.co.uk> wrote:

> What i would like to know is there any way with perl for me to
> create a simple server, so i could say open a local file form the harddrive
> in my webbrowser, then click on a link to execute a perl script which will
> in turn return data to the current browser process.


Any web server will do that.

There are many free web servers available.

What is your Perl question?


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


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

Date: Fri, 19 Sep 2003 16:10:53 +0000 (UTC)
From: "D Borland" <no.name@eidosnet.co.uk>
Subject: Re: simple server
Message-Id: <bkf9qd$7p9$1@titan.btinternet.com>

my perl question was how do i do that i perl, not with Apache, et cetera, or
another server.  I was wondering if perl has an ability to do that.

That was what i asked wasn't it?

D Borland

"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnbmm6r2.gdh.tadmc@magna.augustmail.com...
> D Borland <no.name@eidosnet.co.uk> wrote:
>
> > What i would like to know is there any way with perl for me to
> > create a simple server, so i could say open a local file form the
harddrive
> > in my webbrowser, then click on a link to execute a perl script which
will
> > in turn return data to the current browser process.
>
>
> Any web server will do that.
>
> There are many free web servers available.
>
> What is your Perl question?
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas


---
This e-mail has been virus scanned and is certified virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/03




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

Date: Fri, 19 Sep 2003 10:02:55 -0500
From: "Kubaton Lover" <nospam@goawayspam.com>
Subject: Writing out part of a file
Message-Id: <vmm6l2numbeo92@corp.supernews.com>

This is a newbie question I'm sure, but I couldn't find a "good" way to
handle this problem.

I have an XML file that is being read by a Perl script.  The fact that it is
XML is superfluous.

I want to open the file, print the first 2 lines of the file out, then print
out a line or two of something else, then print out the remaining portion of
the file.

I tried:

while (<CODE>) {
    print $_;
    last;
}
print "my stuff here\n";
while (<CODE>) {
    print $_;
}

This works fine for printing just the first line of the file and I figure
that I could add a counter and break out when that counter reaches a certain
number, but is there a "better" (more efficient) way to accomplish this
task?

Thanks.




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

Date: Fri, 19 Sep 2003 10:26:57 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: Writing out part of a file
Message-Id: <ScFab.710$T32.27300@news.uswest.net>

Kubaton Lover wrote:
> This is a newbie question I'm sure, but I couldn't find a "good" way to
> handle this problem.
> 
> I have an XML file that is being read by a Perl script.  The fact that it is
> XML is superfluous.
> 
> I want to open the file, print the first 2 lines of the file out, then print
> out a line or two of something else, then print out the remaining portion of
> the file.
> 
> I tried:
> 
> while (<CODE>) {
>     print $_;
>     last;
> }
> print "my stuff here\n";
> while (<CODE>) {
>     print $_;
> }
> 
> This works fine for printing just the first line of the file and I figure
> that I could add a counter and break out when that counter reaches a certain
> number, but is there a "better" (more efficient) way to accomplish this
> task?
> 
> Thanks.
> 
> 

open (F, "<file") || die "$!";
print "First=",scalar <F>; #or into a variable .. my $l1 = <F>;
print "Second=", scalar <F>;
print "Rest is:\n";
while (<F>)
{
	print;
}
close F;

Or, if your file is fairly small, just slurp it all into an array then 
print the various indexes of the array.



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

Date: Fri, 19 Sep 2003 10:29:00 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Writing out part of a file
Message-Id: <slrnbmm85s.gk0.tadmc@magna.augustmail.com>

Kubaton Lover <nospam@goawayspam.com> wrote:

> I want to open the file, print the first 2 lines of the file out, then print
> out a line or two of something else, then print out the remaining portion of
> the file.


   # untested
   print scalar <CODE>;
   print scalar <CODE>;
   print "my stuff here\n";
   print while <CODE>;


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


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

Date: Fri, 19 Sep 2003 12:57:57 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: wtf is the deal?
Message-Id: <p3Dab.7348$E36.603@nwrddc02.gnilink.net>

Tom wrote:

> Now there is about the most childish bullshit I've seen in a long
> time. Grow the fuck up. Ahh, that explains it, Texas.

*PLONK*

jue




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

Date: Fri, 19 Sep 2003 09:25:07 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: wtf is the deal?
Message-Id: <slrnbmm4e3.fuq.tadmc@magna.augustmail.com>

Tom <tom@nosleep.net> wrote:


[snip full-quote]


> Now there is about the most childish bullshit I've seen in a long time.


Being ostracised for socially unacceptable behavior has been
practiced by humans of all ages for thousands of years.


> Grow the fuck up. 


Potty mouth. That is sure to convince us your superior intellect.


> Ahh, that explains it, Texas.


Ad hominem weakens your position.

Thanks for the help.


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


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

Date: Fri, 19 Sep 2003 11:19:05 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: wtf is the deal?
Message-Id: <eton0d0pugm.fsf@wormtongue.emschwar>

"Tom" <tom@nosleep.net> writes:
> I didn't top post anything after ANYONE asked me to stop.
> If anyone said anything, I never saw it.
> As far as reading backwards in time, that is exactly the preferred way for
> Engineering, unless comments are inlined with quetsions, etc.

As an engineer (not an Engineer, nor a P.E., etc.), you are exactly
wrong.  It's fine to have your personal preferences, but

A) Don't try to pass them off as anything else, and
B) When informed things work differently here, it's proper to take
   that into account.

> I don't want to have to constantly scroll past what I already read a dozen
> times to get to what was responded to last.

And I don't want to have to scroll down three pages to figure out what
"yes, that's a good idea" refers to.

> This is the 'proper' way to converse technical info, at least in the
> engineering world.

Having worked in fields ranging from embedded systems to software QA,
I can definitively state that you're wrong.  That is not the 'proper'
way to do anything but confuse and irritate your audience.

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


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

Date: 19 Sep 2003 04:23:41 -0700
From: c_j_marshall@hotmail.com (Chris Marshall)
Subject: Re: WWW::Mechanize click() returns "Unexpected field value"
Message-Id: <cb9c7b76.0309190323.388c2932@posting.google.com>

nospam_timur@tabi.org (Timur Tabi) wrote in message news:<53bb806a.0309171351.44b4ee42@posting.google.com>...
> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbmgtp6.7o0.tadmc@magna.augustmail.com>...
> 
> > What did your Perl friend say when you asked him about it?
> 
> He said that it works for him and he has no idea why it doesn't work
> for me.  He also could not tell me how to debug it.

So your problem is that you're trying to run a perl script which was
written by someone who does't know how to debug it and has no idea why
it doesn't work.

mmmm.


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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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.  

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


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