[16404] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3816 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 27 00:05:22 2000

Date: Wed, 26 Jul 2000 21:05:07 -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: <964670707-v9-i3816@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 26 Jul 2000     Volume: 9 Number: 3816

Today's topics:
    Re: cookie and redirect trouble... <hansson.anders@goteborg.utfors.se>
    Re: cookie and redirect trouble... (brian d foy)
    Re: Critiques, please (BUCK NAKED1)
    Re: difference between two times in seconds hayati@math.berkeley.edu
    Re: difference between two times in seconds <uri@sysarch.com>
    Re: Do I Need Chomp? <was Critiques, please> (BUCK NAKED1)
    Re: Formatting text file <noemail@nodomain.com>
    Re: Formatting text file <flavell@mail.cern.ch>
    Re: Installation problem with Perl 5.6 in Cygwin <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Need code to parse MSIE 5.x Cookie Files <Timothy.Clemmer@lexis-nexis.com>
    Re: Nobody loves me? (Clinton A. Pierce)
    Re: Nobody loves me? <jason@mybowie.com>
        plotting graph <dvoon@my-deja.com>
    Re: plotting graph <bwalton@rochester.rr.com>
    Re: Script for copy all the site <jevon@islandtelecom.com>
        seeing $main::FOO in used module <newt@veko.ne.mediaone.net>
    Re: Simple Newbie Question <jevon@islandtelecom.com>
    Re: Was Why won't  "use strict;"  work? (BUCK NAKED1)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Jul 2000 03:43:24 -0700
From: "Anders Hansson" <hansson.anders@goteborg.utfors.se>
Subject: Re: cookie and redirect trouble...
Message-Id: <8lo3ed$gu8$1@yggdrasil.utfors.se>

First, Thanks to all for your help, and for your quick replies...

Ill have a look at cgi.pm .... as of now, I dont know how it works/what it
is... Im somewhat of a newbie to perl.. Learning.

"no-parsed-headers"-script? what does this mean more specific? Do I have to
send them in a single print? without \n?

Once again, thanks..

/Anders

"brian d foy" <brian@smithrenaud.com> wrote in message
news:brian-ya02408000R2607000035070001@news.panix.com...
> In article <Pine.GHP.4.21.0007252348370.26198-100000@hpplus03.cern.ch>,
"Alan J. Flavell" <flavell@mail.cern.ch> posted:
>
>
> > 2. Apparently, you have to treat all scripts for IIS as
> > no-parsed-headers scripts.  Again, CGI.pm can take care of the
> > details.
>
> CGI.pm *will* take care of the details.  if the server is IIS,
> CGI.pm acts as if it's a nph script by setting the nph flag.
>
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> Perl Mongers <URL:http://www.perl.org/>




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

Date: Wed, 26 Jul 2000 21:51:40 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: cookie and redirect trouble...
Message-Id: <brian-ya02408000R2607002151400001@news.panix.com>

In article <8lo3ed$gu8$1@yggdrasil.utfors.se>, "Anders Hansson" <hansson.anders@goteborg.utfors.se> posted:

> First, Thanks to all for your help, and for your quick replies...
> 
> Ill have a look at cgi.pm .... as of now, I dont know how it works/what it
> is... Im somewhat of a newbie to perl.. Learning.
> 
> "no-parsed-headers"-script? what does this mean more specific? Do I have to
> send them in a single print? without \n?

just use CGI.pm and you don't have to worry about it.  if you want to worry about it, you can start with the CGI Meta FAQ.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Wed, 26 Jul 2000 22:16:05 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Critiques, please
Message-Id: <12618-397FA975-88@storefull-247.iap.bryant.webtv.net>

>>dennis100@webtv.net wrote: 
>>seek(COUNT, 0, 0) or die "can't >>REWIND to beginning of data
>>file: $!"; 

>marcel@codewerk.com wrote: 
>REWIND? Are you running your
>web site off a tape drive? 

Is this a semantics argument? I think I get your point though(improper
wording?). Are you saying that the file doesn't actually "rewind?"
Perhaps I should verbalize it as "can't POINT to beginning of file" or
"can't FIND beginning of data file" for my die statement?

Regards,
Dennis



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

Date: Thu, 27 Jul 2000 01:40:40 GMT
From: hayati@math.berkeley.edu
Subject: Re: difference between two times in seconds
Message-Id: <8lo3uo$ip8$1@nnrp1.deja.com>

In article <slrn8nv26d.vcg.abigail@alexandra.foad.org>,
  abigail@foad.org wrote:

> :) >David T. Liu <david.t.liu@intel.com> wrote in message
> :) >news:8ln97m$fnn@news.or.intel.com...
> :) >> What's the quickest way to get the difference between two time
objects in
> :) >> seconds?
>
> There's nothing that can't be solved with a regex.
>
> sub datediff {
>     local ($_, $:) = map {1 x $_} $_ [0] > $_ [1] ? @_ : reverse @_;
>     s/$:// and length;
> }

This seems to be very magical and beautiful but unfortunately I've been
trying to figure out what the heck it does, to no avail :) I'd be very
grateful to see an explanation of it.


Thanks,
Katia Hayati




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


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

Date: Thu, 27 Jul 2000 03:06:52 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: difference between two times in seconds
Message-Id: <x7g0ow6zlh.fsf@home.sysarch.com>

>>>>> "h" == hayati  <hayati@math.berkeley.edu> writes:

  h> In article <slrn8nv26d.vcg.abigail@alexandra.foad.org>,
  h>   abigail@foad.org wrote:

  >> There's nothing that can't be solved with a regex.

unfortunately true! :)

  >> sub datediff {
  >> local ($_, $:) = map {1 x $_} $_ [0] > $_ [1] ? @_ : reverse @_;
  >> s/$:// and length;
  >> }

ok, fasten your seatbelt, it's going to be a bumpy night!

let's start from the first line and the right side:


$_ [0] > $_ [1] ? @_ : reverse @_;


those vars around > are just the 2 first args passed into the sub. the
space there is ignored which a typical abigail trick. so all that is
doing is seeing if the first arg is greater than the second. if so it
just keep them in that order else it reverse the list (just swapping
them) so you get a pair of numbers with the larger one first. of course,
this break horribly if you pass it anything but 2 arguments.

the next part is:

map {1 x $_}

which is a simple operation on that list of 2 numbers from above which
creates 2 strings of '1's with the longer one first.

next the 2 strings are just assigned to $_ and $:. $: has no
signifigance here but is some obscure format var no one ever uses. it
looks cool.

then comes the substraction:

s/$://

that s/// operates on $_ (which is the longer string of 1's) and just
replaces the shorter string of 1's (in $:) with nothing. that
effectively subtracts the two numbers.

and then:

and length

just returns the length of $_ which is the result you want, the
difference between the 2 arguments.

cute, but not as complicated as many of abigail's japh's.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 26 Jul 2000 22:31:13 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Do I Need Chomp? <was Critiques, please>
Message-Id: <12618-397FAD01-94@storefull-247.iap.bryant.webtv.net>

Do I need to add "chomp" (as I have now done) in the coding below? Why
or why not? Doesn't "truncate" do the same thing as "chomp"? (one
question per Larry Rosler's suggestion)
NOTE: ignore line spaces... I'm manually putting them in for easier
reading since my newsreader wants to wrap the code.


#!/usr/local/bin/perl -w

use strict;

use Fcntl qw/:flock :DEFAULT/;

my $counter = 'counter.dat'; 

sysopen(COUNT, $counter, O_RDWR|O_CREAT)         or die "Can't OPEN data
file for READING and WRITING: $!"; 

flock(COUNT, LOCK_EX)       or die "Cannot get an EXCLUSIVE LOCK on data
file: $!";

my $num = <COUNT> || 0; 

chomp $num;

$num++; 

seek(COUNT, 0, 0)      or die "can't REWIND to beginning of data file:
$!"; 

truncate(COUNT, 0)      or die "can't TRUNCATE data file: $!";

print COUNT "$num\n"; 

1 while $num =~ s/(.*\d)(\d\d\d)/$1,$2/;

       for($num) {

                       s/(1[123]|[4-90]$)/$1th/ 
       
                  or  s/(1$)/$1st/ or s/(2$)/$1nd/ 
                  or s/(3$)/$1rd/;
                     
                        }; 

print "Content-type: text/html\n\n"; 

print("You are the $num visitor to this 

webpage"); 

close COUNT or warn $!;

## END SCRIPT 


Regards,
Dennis



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

Date: Thu, 27 Jul 2000 01:39:37 GMT
From: "Coy" <noemail@nodomain.com>
Subject: Re: Formatting text file
Message-Id: <tpMf5.10331$Mt.126398@nnrp1.ptd.net>

 .....

: The sentence retained above from my post contains the hint needed to
: address this problem:  the use of a two-dimensional data structure.  The
: original poster is expected to take such a hint and try to generate code
: that works.
:
: Had I chosen to, I might have strengthened the hint by pointing
: explicitly to the Perl documents perldsc and perllol.  But until code
: was shown indicating that those resources had been used, neither I nor
: others would feel a compelling need to show specific code solutions.  As
: any code would have to be tested, the effort required for such a mundane
: problem as this wouldn't be warranted -- at least until the original
: poster had tried and needed more help.

Ok, you are correct that a 'hint' was given. Although, when I post a question
or a problem, I would never expect a guessing game in return.
I'm sure any poster w/ a problem has taken a lot of time, and
exhausted any and all options that he knows about..
I'd hate to waist his time by giving him a vague answer
and make him do more work...

To the reply (well, posting incorrect information is waisting his time)
Regardless, it was an attempt to be helpful. If there were more people
who at least attempted to be helpful, the world would be a better place.

: Had you lurked here a while, you would have seen that certain criteria
: are used to judge the acceptability of posted responses.  The ones that
: come most immediately to mind are:
:
:     Posting of tested code, unless specifically identified as such.
:
:     Posting of code that compiles and runs without warnings (use of the
: '-w' flag).
:
:     Posting of code that compiles properly with the 'use strict;'
: pragma.  This specifically rules out the use of symbolic references,
: which you were attempting to do by means of code such as this:
:
: > : >      if (@row . $num) {
: > : >         # I have no idea if u can call a dynamic array like this
: > : >                                      # e.g: @row . $num  = @row2
:
:     Posting of advice only in areas where the responder has some
: knowledge.  Your comment above specifically disclaims knowledge of what
: you were trying to help with.

Yes, I have little knowledge in what the 'correct' answer would be, which is
why I said 'if i had to take a guess'.
And if there are certian criteria to posting on newsgroups, id like to see the
R&R (Rules and Regulations) page.
Granted, we all adapt to are environment, but to those who don't 'lurk around awhile'
and just use the newsgroups for what 'I thought' they were intended for.. help,
don't get that luxoury.
I'll be sure to put some time in my own busy schedule to 'lurk around here a while',
so as not to raise the hairs on anyones neck.

: Not only are posts here distributed worldwide, they are archived.  The
: archives may be used as references by people seeking authoritative
: information or advice.

I'm sure this will be useful information.

: That is my understanding of what *this* newsgroup is.  There are other
: opportunities for contributors with less desire for professionalism.
: I'm told that alt.perl is one such, though the HP Labs news server
: doesn't offer it (for good reason :-), so I've never seen it.  I don't
: think I'm missing much!

less desire for professionalism?
Well, once I figure out how to ram a rather large stick up my ass
call myself perfect, walk tall and proud, without error,
I'll be able to mingle then, won't I

<snip of my comment>
: > Or do you not understand what a newsgroup is ?
: > Coming from HP Labs I would have thought otherwise,

I take back this comment only because it was spoken out of anger.

However, I do not allow myself, or anyone else to be barked at,
and insulted the way you (apparently unaware) did.
Remember in grade school, the bully who walked around mouthing off
to everyone?   I was the one that kicked him in the teeth for it.

but regardless, I didn't play that game then, and I don't play it now.
If I am in error, fine. Correct me, and I will move on.
Bark at me, insult me, etc..  and your going to see another side of me.
Comments like:
  <snip>
    : Perhaps you should go back to sleep until you can offer useful
    : suggestions.
  </snip>
Thank god you weren't in arms length...

I don't mean to disrespect the newsgroup, or you for that matter.
Your a highly decorated individual who has spent a lot of his time
contributing to this community.
But I do not recognize this as being a 'get out of jail free' card for anyone.

I'm sure you see my point.





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

Date: Thu, 27 Jul 2000 03:49:44 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Formatting text file
Message-Id: <Pine.GHP.4.21.0007270342170.13013-100000@hpplus03.cern.ch>

On Thu, 27 Jul 2000, Coy wrote:

> To the reply (well, posting incorrect information is waisting his time)
> Regardless, it was an attempt to be helpful. If there were more people
> who at least attempted to be helpful, the world would be a better place.

Your waist measurements are of no particular interest to the Perl
programming group, but I'm glad to see that I made the right
assessment on the basis of youre first response, of scoring you down
preparatory to entry into the killfile.

A low-quality answer "in an attempt to be helpful" is generally agreed
to be unhelpful, when high-quality answers are already available in
the freely accessible documentation and/or FAQs.  If you _prefer_ the
low quality answers, then that's your democratic right, but kindly
don't try to impose them on the rest of us.

-- 

      A patent application requires an implementation, 
      which is impossible due to the lack of sufficently 
      dense material to make one that would work.
       - Glenn Randers-Pehrson discussing specification for a clue-stick



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

Date: Wed, 26 Jul 2000 19:30:35 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
To: RichardWoodward@hotmail.com
Subject: Re: Installation problem with Perl 5.6 in Cygwin
Message-Id: <397F9ECA.A1084854@jpl.nasa.gov>

[posted and mailed]

RichardWoodward@hotmail.com wrote:
> I configured my Perl very conservatively, using recommended default
> answers.  The output file "myconfig" is shown below.  When I ran
> "make" I got messages about some "export definition" file problem
> and some failure message about a reallocation problem.  I have a
> fairly short make log which I generated and have also shown below.

<snip> 

> dllwrap: no export definition file provided
> dllwrap: creating one, but that may not be what you want
> 
> Cannot reallocate 1652555776 bytes after allocating 68577308 bytes
> perlld: *** system() failed to execute

binutils 2.10 (the version released with the latest cygwin) has a bug in
dllwrap.  Get a weekly snapshot from
http://sources.redhat.com/binutils.  I just built perl using the 7/25
snapshot.

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Wed, 26 Jul 2000 16:32:41 -0400
From: "Timothy Clemmer" <Timothy.Clemmer@lexis-nexis.com>
Subject: Re: Need code to parse MSIE 5.x Cookie Files
Message-Id: <8lnhtn$436$1@mailgate2.lexis-nexis.com>

In light of the recent hullabaloo going on in this newsgroup regarding folks
who don't like terse answers, and other folks who are annoyed by people not
doing their homework, I'd like to state that I've plowed through archived
posts and perldocs, and I'd really like somebody to answer -- you can even
be terse; I don't care -- I'll be really grateful; I swear!  So far, I've
found only the HTTP::Cookies::Netscape documented with HTTP::Cookies in
October 1997, but nothing about MSIE cookie file formats in the ensuing 3
years.  Please help.
-tim

Timothy Clemmer <Timothy.Clemmer@lexis-nexis.com> wrote in message
news:8l9ks1$dj1$1@mailgate2.lexis-nexis.com...
> I'm using HTTP::Cookies on a PC and would like to load the cookie jar with
> the user's cookies as saved by Microsoft Internet Explorer.
>
> Has anybody done this?  Any advice?
>
> While Netscape's format is well documented on the web, I have found
precious
> little about the format of the MSIE cookie files.  I know where they are,
> and I know the naming scheme, but have yet to discover the format.
Perhaps
> there's a module for me on CPAN?
>
> Please help!
>
> -tim
>
>
>
>




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

Date: Thu, 27 Jul 2000 01:17:08 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Nobody loves me?
Message-Id: <o4Mf5.52714$fR2.477843@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <397F6E59.88A3D6D9@mybowie.com>,
	Jason Dixon <jason@mybowie.com> writes:
>> [attribution lost -mjc?]
>> The points were valid, and if someone lurking out there absorbed a
>> little nettiquette, then the post you're so upset over served it's
>> purpose.

Indeed, it did.

> I'm not upset over his suggestions; I have no problem with that, and see
> that his point is valid.  

Points, there were two.  The bad subject lines and the impatience.
Both of which will earn you no answers.  I've removed comp.lang.perl.modules
because this is probably not relevant to that group anymore.  It's really
not relevant to Perl anymore, but I'll let the thread live on there for
now.

> I'm not sure where to go now... 

Try this: I have similar problems here faking "geeksalad.org" headers when
that's not my ISP or relay host.

The mail host is on your box?  Then telnet to the SMTP port and try lying
about who you are.  You can find instructions for sending mail manually
on the net.  (Look for "MAIL FROM" and "RCPT TO" stuff in the instructions.)

If you find that, even by lying, you can't get sendmail to give you the 
correct return address then you have to investigate sendmail's configuration.

Become "root" or another trusted sendmail user, and try sending mail 
from the command line with "sendmail -f".  If that works, great.  I think
-f only lets you set the user name though, not the domain.  So then...

You're going to have to re-configure sendmail to allow you to use 
this other hostname as an alias.  Myself, I used a DMgeeksalad.org line
in the sendmail.cf file and rebuilt it.  I guess there's a macro facility
for building sendmail configurations, but I've never learned to use it.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Thu, 27 Jul 2000 02:00:48 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Nobody loves me?
Message-Id: <397FA86F.EEBF10BF@mybowie.com>

> > I'm not upset over his suggestions; I have no problem with that, and see
> > that his point is valid.
>
> Points, there were two.  The bad subject lines and the impatience.

Granted, the current posting was mucho lame-o, but I was concerned that the
message was going to get "lapped" for the third time.  Hindsight, I know better
now.  However, I don't see any problems with the other subject lines "Perl Mail
Headers Question" and "Custom Mail Headers with Perl".  I still feel that those
are both appropriate to the posting.

> The mail host is on your box?  Then telnet to the SMTP port and try lying
> about who you are.  You can find instructions for sending mail manually
> on the net.  (Look for "MAIL FROM" and "RCPT TO" stuff in the instructions.)
>
> If you find that, even by lying, you can't get sendmail to give you the
> correct return address then you have to investigate sendmail's configuration.
>
> Become "root" or another trusted sendmail user, and try sending mail
> from the command line with "sendmail -f".  If that works, great.  I think
> -f only lets you set the user name though, not the domain.  So then...
>
> You're going to have to re-configure sendmail to allow you to use
> this other hostname as an alias.  Myself, I used a DMgeeksalad.org line
> in the sendmail.cf file and rebuilt it.  I guess there's a macro facility
> for building sendmail configurations, but I've never learned to use it.

I also feel that the problem is probably lying within the sendmail configuration
(unfortunately).  I'll research the SMTP socket instructions and try that.  I
have tried other low-level attempts with sendmail to obtain the same results, to
no avail, but I'll try your suggestion as well.

I'm glad that this thread is finally becoming productive... thanks for your
patience, assistance, and persistence.  "There's a lotta love in this room right
now... "

Thanks,
Jason

P.S.  I'd still LOVE to get the Mail::Mailer module working correctly.  If
there's anyone else out there that has suffered the same dilemma and deducted
that the problem was due to the sendmail configuration, please let me know.
-TIA.



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

Date: Thu, 27 Jul 2000 01:29:56 GMT
From: dVoon <dvoon@my-deja.com>
Subject: plotting graph
Message-Id: <8lo3ai$iav$1@nnrp1.deja.com>

Hi all,

I know how to use Perl to retrieve data from database and then generate
an HTML table. But is there a way of using Perl to plot graphs (e.g.
line graph showing composite index) and send the graph to HTML client? I
thought of using Perl to retrieve the data and send it to a java applet
(which plots graphs) as argument, but since I don't know java, are there
other ways to do it?

Thanks for any help.

Daniel


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


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

Date: Thu, 27 Jul 2000 03:34:37 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: plotting graph
Message-Id: <397FAE07.D4188449@rochester.rr.com>

dVoon wrote:
 ...
> I know how to use Perl to retrieve data from database and then generate
> an HTML table. But is there a way of using Perl to plot graphs (e.g.
> line graph showing composite index) and send the graph to HTML client? I
> thought of using Perl to retrieve the data and send it to a java applet
> (which plots graphs) as argument, but since I don't know java, are there
> other ways to do it?
 ...
> Daniel
 ...
Sure.  Just include an <img src="whatever.pl"> tag in your CGI script's
output, and write whatever.pl to generate a Content-type corresponding
to an image, like image/gif, perhaps.  Then use any image-generation
module in Perl, like maybe GD, to create an image of the type specified
in Content-type on standard output.  Best to set STDOUT to binmode.  I
find this technique works very well for generating on-the-fly graphs of
data for the web.  If you need to pass parameters from the generated
HTML to whatever.pl, you can do that by placing them like <img
src="whatever.pl?p1=v1&p2=v2">.  Of course, it is good to include the
width and height of the image in the img tag so the web page will render
before the image is compeltely transmitted.
-- 
Bob Walton


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

Date: Thu, 27 Jul 2000 03:34:02 GMT
From: "Jevon MacDonald" <jevon@islandtelecom.com>
Subject: Re: Script for copy all the site
Message-Id: <K4Of5.97$Eq1.18965@sapphire.mtt.net>

No, We just don't want the entire web on a local mirror..

"Pablo Lambert" <plambert@reuna.cl> wrote in message
news:397F3DC0.72007999@reuna.cl...
> Hello:
>         I am searching for a tool that allows me copy some remote site
> via http, to my local filesystem. I have already downloaded
> CPAN/sitemapper, but this tool only make a map of the site.
>
> I have also try MasterSnooper.pl but does not work recursively. It works
> only with one page and does not follow the links.
>
> I think that the perl community is so smart that this litte tools must
> be done!
>
> Thanks in advance,
>




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

Date: Thu, 27 Jul 2000 01:29:59 GMT
From: <newt@veko.ne.mediaone.net>
Subject: seeing $main::FOO in used module
Message-Id: <rgMf5.50354$Q8.388049@typhoon.ne.mediaone.net>
Keywords: Modules, main::, package

Can the code inside a module 'see' values from the script that uses them?
I'm trying and failing with the following:

--------foo.pl-------
#!/usr/bin/perl
$VAL = "HI";
use bar;
---------------------
--------bar.pm-------
package bar;
eval {
    print "main::VAL is $main::VAL\n";
};
1;
---------------------

I've found that I can _create_ $main::VAL from my package if it doesn't
exist yet, but if it alredy exists, the package can't see its value.

Any help is appreciated.


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

Date: Thu, 27 Jul 2000 03:32:27 GMT
From: "Jevon MacDonald" <jevon@islandtelecom.com>
Subject: Re: Simple Newbie Question
Message-Id: <f3Of5.96$Eq1.18991@sapphire.mtt.net>

If you are doing a redirect script.. You want to print a header.. It should
look something like this

print "Location: http://myvariablesentmehere.com\n\n";

"Marcus Ouimet" <mouimet@direct.ca> wrote in message
news:y6Hf5.70029$8u4.713601@news1.rdc1.bc.home.com...
> I am trying to use my script to automatically go to a url depending on a
> variable. Is there a way to use something like:
>
> $in{URl} .= "whatever.com"
>
> A long shot but maybe someone can point me in the right direction.
>
>




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

Date: Wed, 26 Jul 2000 22:04:11 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Was Why won't  "use strict;"  work?
Message-Id: <12620-397FA6AB-12@storefull-247.iap.bryant.webtv.net>

lr@hpl.hp.com wrote:
>Your questions were posted, but
>were difficult to read, so people >responded to the form, not the
>content. I tried to reply to the 
>questions, but got bogged down
>in the mess.

I apologize for the poor form of that post. That's really strange. I
took much longer to write that post than any other that I have posted in
here, and was more careful than on any other post to make sure it was in
proper order. I even had the thoughts numbered, and though it was well
organized.

I don't know what happened. It could be my newsreader?... WebTV doesn't
quote well, and my PC's ISP's mail service is always screwing up... and
both of them wrap lines that I wish they wouldn't... and  I also suspect
that many of the mistakes are my own doing.

I really think the questions were good ones, though. I'm sorry to hear
that you decided to ignore the "content" due to its form. I assure you
that it  was not intentional.
 
>As you have five questions, I would >suggest you separate them out into
>one question per post, formatted in
>plain text and with descriptive ubjects. >You are far more likely to
receive >answers that way. 

Perhaps, you are right. I had a feeling it was too many questions for
one post, that's why I concised it from 10, down to 5 questions. I
thought that wouldn't be too much. Obviously, I was wrong. 

FWIW, I also started a "Critiques please" thread (where I may try and
re-state the questions), out of consideration to others. I was
attempting to end the thread(Why...use strict) that was getting long.
Long threads, IMHO, make it difficult to navigate newsgroups.

Regards,
Dennis



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

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


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