[13802] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1212 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 28 12:10:27 1999

Date: Thu, 28 Oct 1999 09:10:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941127016-v9-i1212@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 28 Oct 1999     Volume: 9 Number: 1212

Today's topics:
    Re: MS ACCESS and Perl <oneillNOonSPAM@cs.uregina.ca.invalid>
        Newbie - ActivePerl - Including a web page <qwe@qwe.com>
    Re: Perl Cookie questions and stuff <james_peregrino@harvard.edu>
    Re: perl lang parser (Matthew Bafford)
        perlguts question <rhomberg@ife.ee.ethz.ch>
    Re: Pulling Client IP configuration (DNS WINS etc) sandman69@my-deja.com
    Re: Regular Expression <r28629@email.sps.mot.com>
    Re: Regular Expression <gellyfish@gellyfish.com>
    Re: Require statement <jboes@qtm.net>
        Sub in which module <samay1NOsaSPAM@hotmail.com.invalid>
    Re: ummz .. Regular expressions on multiple lines.. and <duthler@tebenet.nl>
    Re: uniq and perl <aqumsieh@matrox.com>
    Re: Win32::Internet mullman69@my-deja.com
    Re: Win32::Internet <perin@panix.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 28 Oct 1999 07:24:11 -0700
From: oneill78 <oneillNOonSPAM@cs.uregina.ca.invalid>
Subject: Re: MS ACCESS and Perl
Message-Id: <0f61f07e.11f66fe6@usw-ex0110-073.remarq.com>

Do you know of any good books that I can follow to help me
set up a database using perl.  We use coldFusion at work
but I can not afford to buy it.
Thanks
Ross


* Sent from AltaVista http://www.altavista.com Where you can also find releated Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: Thu, 28 Oct 1999 16:33:41 +0100
From: "Paul Cook" <qwe@qwe.com>
Subject: Newbie - ActivePerl - Including a web page
Message-Id: <941124746.19609.0.nnrp-13.9e980799@news.demon.co.uk>

Hi, I've got a .pl script which is supposed to merge a html file with what
it output (basically sticks a header on the page before outputting the rest
of the page). I'm using ActivePerl on PWS4 but this doesn't seem to work.

sub page_header{
  open (READIT,"$templatedir/header.html");
  read (READIT, $header, 20000,0);
  close (READIT);
  print $header;
}

Any ideas? I'm no Perl expert but I've checked the docs and AFAIK this is
correct.

Thanks

Paul.




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

Date: 28 Oct 1999 11:34:19 -0400
From: James Peregrino <james_peregrino@harvard.edu>
Subject: Re: Perl Cookie questions and stuff
Message-Id: <x7bt9jbitf.fsf@bert.dce.harvard.edu>

Chuck Williams <chuckwilliams1@netscape.net> writes:

> 1.Which variables can be recovered from the HTTP_COOKIE envar? All I
> can get is the name=value pair.

	Yep.

> 2.In Set-cookie: ...., if I don't set the expires date, the cookie
> doesn't get written to the user's hard drive, right?

	Generally true, but this is technically up to how the browser wishes
to implement it.  A cookie with no expiration date lasts for as long as the
browser is active.  The browser *could* write it to disk and then delete it
when exiting - but then it would also have to have some clean up code to remove
cookies in the even that it crashed before deleting them.
	So the easiest thing to do is keep it in RAM.

> 3.Does it matter in what order I write the Set-cookie: ...  parameters?

	Probably not, but I'd stick with the way it shown in the specs.

> 4.Should there be NO trailing semi-colon on the Set-cookie line?

	The Netscape spec doesn't seem to specify.  But RFC 2109 uses the
semi-colon as a separator, so no trailing semi-colon.

> 5.Is the alpha weekday (Sun Mon Tue...) required in the expires field?

	Yes.  But remember there are essentially two cookie specs:
	1) Netscape's (the original) uses 'expires'
	2) RFC 2109 uses 'max-age'

Freaked out about coding this?  Use CGI.pm; it takes care of all of this for
you.

> 6.Is there a way to make the expires field a variable?

	Umm...variable within the browser?  Or do you mean a range or do you
mean something like "if I'm in domain Y, then expires = now +30 days"?

	???

> 7.If user has cookies turned off, does the expire=blank cookie still
> work?

	No.  Because the browser never gets the cookie.  No name=value pair
ever reaches the browser so what difference does it make?

-James
-- 
James Peregrino
Harvard Div. Continuing Education


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

Date: Thu, 28 Oct 1999 13:48:14 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: perl lang parser
Message-Id: <slrn81gkc6.3aj.*@dragons.duesouth.net>

On 27 Oct 1999 22:31:48 GMT, slganzho@unity.ncsu.edu (Salem Lee
Ganzhorn) enriched us with: 
: I am looking for a package which can parse a perl script and store the 
: information in a structure.

Only perl can parse Perl.
 
: TIA

HTHIA,

: Salem Lee Ganzhorn

--Matthew


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

Date: Thu, 28 Oct 1999 16:37:08 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: perlguts question
Message-Id: <38185F94.E5999ABD@ife.ee.ethz.ch>

I'm having some fun with perlguts...

What is the best way to duplicate a reference?
is the reference count of the referenced object increased, if I make a
copy with newSVsv(reference) or do I have to make a new reference of the
original object? (like newRV_inc(svRV(reference)))

- Alex


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

Date: Thu, 28 Oct 1999 13:02:12 GMT
From: sandman69@my-deja.com
Subject: Re: Pulling Client IP configuration (DNS WINS etc)
Message-Id: <7v9hgi$ou8$1@nnrp1.deja.com>

The protocol in question is TCP/IP.  Basically if I can read their
registry from a WebPage I can get the information I need, or if I can
get the information IPConfig or WinIpcfg provides from their box would
work as well.  They will connect to a webpage that will verify that
they have their DNS, WINS, etc setup correctly.  Basically to save me
heartache of trying to figure out whey they can't do some things. We
just put up new DNS and WINS servers.
Still trying to find the best way... May have to go with Java.. not
sure yet

Thanks,
Shawn
In article <Pine.GSO.4.10.9910271127290.29843-
100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Wed, 27 Oct 1999 sandman69@my-deja.com wrote:
>
> > Is there anyway that I can setup a Web page that allows my clients
> > to connect to and pull their IP configuration and compare
> > it to the setup that they should be using?
>
> It sounds as if you want to connect to your clients' computers and
request
> some information. Yes, this can be done. You'll need to use some
protocol
> which their machine supports to give you the information. (Of course,
> there may not be any such protocol supported for some information;
there's
> no guarantee that the remote machine will answer your questions.) Such
> protocols are beyond the scope of this group. Perhaps you should
search
> for a newsgroup about the operating systems of the target machines.
>
> Cheers!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 28 Oct 1999 11:30:29 -0500
From: TK Soh <r28629@email.sps.mot.com>
Subject: Re: Regular Expression
Message-Id: <38187A2B.159B30C2@email.sps.mot.com>

Apisilp Trunganont wrote:
> 
> Dear,
> 
> I have this variable.
> 
> $a = "[b]abc[/b] [b]def[/b]";
> 
> And I want to change the value of this variable to "<b>abc</b>
> <b>def</b>".

regex? I though the simple tr/// will good enough, don't you think so?

-TK


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

Date: 28 Oct 1999 16:41:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Regular Expression
Message-Id: <38186eb8_1@newsread3.dircon.co.uk>

Apisilp Trunganont <b39ast@ku.ac.th> wrote:
> Dear,
> 
> I have this variable.
> 
> $a = "[b]abc[/b] [b]def[/b]";
> 
> And I want to change the value of this variable to "<b>abc</b>
> <b>def</b>".
> 

You dont need a regular expression - straight translation will do :

$a = "[b]abc[/b] [b]def[/b]";
$a =~ tr/[]/<>/;
print $a;


/J\
-- 
"The most frightening thing on television since Anthea Turner revealed
she had a sister" - Suggs


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

Date: Thu, 28 Oct 1999 15:22:34 GMT
From: Jeff Boes <jboes@qtm.net>
Subject: Re: Require statement
Message-Id: <7v9pnj$vdm$1@nnrp1.deja.com>

In article <J_WR3.21$vx4.2124@news.siol.net>,
  "bostja31" <zvonko.bostjancic@siol.net> wrote:
> Hello!
>
> I'm working on a Perl project and I have problems with require
statement.
> In my script I use require statement like this:
>
>         require "eng_html.pl";
>
> and when I try it on my local computer it returns an error message:
>
>             perl -Ie:/Harije1  e:\harije1\harije.pl
>             Can't locate ang_html.pl in @INC (@INC contains:
e:/Harije1
> C:/Perl/lib C:/Perl/
>             site/lib . e:\Harije-cgi) at e:\harije1\harije.pl line 15.
>

Assuming that your post has a typo, and that you really mean to say

>             Can't locate eng_html.pl in @INC (@INC contains:

(because if you didn't, then you should be able to figure out that the
name of the file you are trying to require is misspelled!),

'require' just traverses the directories in @INC from left to right,
trying to open the file. The file must be readable to the user who is
running the script (but this is not usually a concern under MS-Win,
which I'm assuming you are using based on your file paths.).

Your -I parameter looks to be the culprit. I'm not familiar with how
Active Perl processes it, but you might try

$ perl -I"e:/Harije1"

or

$ perl -Ie:\Harije1

--
Jeff Boes  jboes@qtm.net
http://www.qtm.net/~jboes/


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 28 Oct 1999 08:57:01 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Sub in which module
Message-Id: <1415c574.5bef9648@usw-ex0101-002.remarq.com>

Hi, I have main program which list several use statement and code.
How I can find that particular subroutine is in which module?

Thanks.
Samay..


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 28 Oct 1999 15:48:38 +0200
From: "jan smit" <duthler@tebenet.nl>
Subject: Re: ummz .. Regular expressions on multiple lines.. and ummz ..string/chat to dec or hex .. or something
Message-Id: <7v9k6t$nsv$1@porthos.nl.uu.net>

im gonna check it out ..

Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.9910271135150.29843-100000@user2.teleport.com...
> On Wed, 27 Oct 1999, jan smit wrote:
>
> > Subject: ummz .. Regular expressions on multiple lines.. and ummz ..
>     string/chat to dec or hex .. or something
>
> Please check out this helpful information on choosing good subject
> lines. It will be a big help to you in making it more likely that your
> requests will be answered.
>
>     http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
>
> > i have 2 q's .. 1 is about multiple lines ..
>
> In general, it's better to ask two unrelated questions in two separate
> postings. In that way, you'll have an easier time choosing a subject line
> for each, someone who can answer only one question won't have to ignore
> the other, and follow-ups will be better organized.
>
> > i ready about regular expressions in the documentation .. but i didnt
> > really get is .. asll i understood was that at the ens of the
> > expression there is a /m .. but how do i get that to works if i hafta
> > read something from a file .. and i wanted to search for a matching
> > string that might include an \n .. could somone help me with that .
>
> I'm not clear what you want. But if you want to search for a newline, use
> \n in the pattern. If you want to make the line anchors ^ and $ match at
> newlines which aren't at the start or end of the string, use the /m
> modifier. If you want to make the wildcard dot ( . ) match any character
> at all, instead of any character except newline, use the /s modifier. See
> perlre and perlop.
>
> > and the other problem is get the first 3 character of a string and
> > turning them into a decimal value or hexadecimal .. doesnt really
> > matter .. if someone could help me with these too .. or does ne1 know
> > where i can find an example??
>
> It sounds as if you want substr(), and maybe hex(). See the perlfunc
> manpage.
>
> Cheers!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Thu, 28 Oct 1999 10:53:07 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: uniq and perl
Message-Id: <x3yln8n8rl8.fsf@tigre.matrox.com>


mr_geek <mr_geek@my-deja.com> writes:

> I want to know how I can (within perl) manipulate my output to print
> only 1 occurence of a string (exactly like UNIX's uniq).

A few elegant solutions are (where else?) in the FAQs. Checkout
perlfaq4:

	How can I extract just the unique elements of an array?

HTH,
--Ala



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

Date: Thu, 28 Oct 1999 13:38:27 GMT
From: mullman69@my-deja.com
Subject: Re: Win32::Internet
Message-Id: <7v9jke$qks$1@nnrp1.deja.com>


> How do I install Net::FTP for my Win 98 machine?  I was under the
> impression that the only modules that work with ActiveState Perl are
> those which can be accessed through the PPM.  I did some searching
> using PPM and didn't find it.

Net::FTP is part of the libnet collection and this CAN be accessed
through ActiveState's PPM.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 28 Oct 1999 10:47:58 -0400
From: Lewis Perin <perin@panix.com>
Subject: Re: Win32::Internet
Message-Id: <pc7u2nbtuch.fsf@panix6.panix.com>

"No One" <nothing@nowhere.com> writes:

> >First, are you sure there's a logfiles directory *immediately below*
> >the directory FTP puts you into at login?
> 
> Yes, that was the first thing I checked and it is directly below the
> "root"

Not to be unduly pedantic, but are you sure you're placed in the root
directory on FTP login?

/Lew
-- 
Lew Perin / perin@mail.med.cornell.edu / perin@acm.org
www.panix.com/~perin/


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 1212
**************************************


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