[12868] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 278 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 27 23:17:17 1999

Date: Tue, 27 Jul 1999 20:05:09 -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           Tue, 27 Jul 1999     Volume: 9 Number: 278

Today's topics:
    Re: Beginner-friendly group as cultural adaptation? (J. Moreno)
    Re: Beginner-friendly group as cultural adaptation? <tex@engsoc.carleton.ca>
    Re: Beginner-friendly group as cultural adaptation? <uri@sysarch.com>
    Re: beginner-redirect and download <emschwar@rmi.net>
    Re: Can anyone explain concepts of Perl Objects? <smorton@pobox.com>
    Re: Conversion Question?? (Abigail)
    Re: Conversion Question?? <tchrist@mox.perl.com>
        Date? <acafounder@crosswinds.net>
    Re: Date? <tchrist@mox.perl.com>
        DBM question <zeng@haas.Berkeley.EDU>
    Re: DBM question <bwalton@rochester.rr.com>
    Re: ebcdic packed numbers <frech@primary.net>
    Re: Getting Height and Width of GIF/JPEG in PERL? (Abigail)
    Re: Getting Height and Width of GIF/JPEG in PERL? <tchrist@mox.perl.com>
    Re: Getting Height and Width of GIF/JPEG in PERL? <revjack@radix.net>
    Re: Getting Height and Width of GIF/JPEG in PERL? <revjack@radix.net>
        Has Perl been Ported to the Palm Pilot OS?       passme (Jamie Jackson)
    Re: negated compiled regexp <ltl@rgsun5.viasystems.com>
        Newbie needs help to connect to MS Access <N.Wendel@mailbox.gu.edu.au>
    Re: Pass by value or pass by reference? <c8133594@comp.polyu.edu.hk>
    Re: Perl Anonymity Question (gulp!) (Martien Verbruggen)
        print problem <acafounder@crosswinds.net>
    Re: print problem (Steven Smolinski)
        Retrieving News by message_id using net::NNTP <jewell.anderson@mciworld.com>
    Re: Trouble with sort (Larry Rosler)
    Re: why perl? <kin@0011.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 27 Jul 1999 21:39:37 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <1dvm1g6.1cprc3t1hd2sdfN@roxboro0-0039.dyn.interpath.net>

Larry Rosler <lr@hpl.hp.com> wrote:

> 12:49:31 GMT, Malcolm Ray <M.Ray@ulcc.ac.uk> says...
>
> > Your mission, should you choose to accept it, is to find a way to
> > motivate your friendly troops while preventing burn-out.
> 
> I would characterize c.l.p.moderated as a failure, as its goal relative to
> c.l.p.misc hasn't been met.  I think c.l.p.newbies or whatever would be
> the same.  The 'friendly troops' want to be where the action is -- and
> where the other 'friendly troops' are.

Create comp.lang.perl.newbie for the 'curmudgeons' and
comp.lang.perl.experts for the newbies.  Say what is really going on in
the FAQs and Charters and things ought to work out just fine.

-- 
John Moreno


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

Date: 28 Jul 1999 02:21:33 GMT
From: Clayton L. Scott <tex@engsoc.carleton.ca>
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <7nlpfd$5sd$1@bertrand.ccs.carleton.ca>

You, yes you, John. Stop writing crap like this:
: much participation as something more neutral, like *.beginner or
: *.amateur. And then there's just plain *.newbie.

	How about c.l.p.answers? It could be a moderated newsgroup
 containing all of the FAQs and related docs to really reduce the noise.

	Anyone could be pointed to said group for reference and told to
 come back when their questions meet criteria in the article titled
 "How to phrase a question in c.l.p.misc" etc.

Clayton
-- 
Warning: Dates on calendar are closer than they appear.


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

Date: 27 Jul 1999 23:00:22 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <x7oggxtr5l.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> c.l.p.moderated was formed to provide a high signal-to-noise ratio for 
  LR> those who were unhappy with c.l.p.misc.  The ratio is indeed high, but 
  LR> the signal is very small, because those 'curmudgeons' are still here, 
  LR> where the traffic is.

  LR> I would characterize c.l.p.moderated as a failure, as its goal relative 
  LR> to c.l.p.misc hasn't been met.  I think c.l.p.newbies or whatever would 
  LR> be the same.  The 'friendly troops' want to be where the action is -- 
  LR> and where the other 'friendly troops' are.

i would disagree. moderated's volume has been picking up recently and it
is nice to be able to see all the threads and pick what i want to
read. i actually wonder what the ratio of rejects to accepts is. many of
the posts here would probably pass there and there have been parallel
thread when some bozo (wang) posts the same stuff to both.

as for c.l.p.newbie, i am leaning towards telling them all that alt.perl
is just that. it has low volume, a good amount of poor and wrong
followups and no curmudgeons.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 27 Jul 1999 19:08:21 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: beginner-redirect and download
Message-Id: <xkfpv1dlgxm.fsf@valdemar.col.hp.com>

llornkcor <llornkcor@llornkcor.com> writes:
> Ditto- I dont think it offtopic here, whats the 'misc' in the
> comp.lang.perl.misc mean?? 

It means "things that have to do with perl, but aren't about subjects
that are best covered in more specific comp.lang.perl.* newsgroups".
Questions about the WWW are not questions about Perl, and don't belong
here.

> I think your condescending answers (Abigail) are of poor taste, and
> more off topic than any question here.  

I don't think her answer was condescending at all.  The original poster
apparently doesn't understand how the web works, or [s]he wouldn't have
asked it in the first place.  And the question wasn't even "how do I do
this in Perl", but simply "how do I do something with a browser", which
indicates the questions either belongs in a newsgroup about browsers or
a newsgroup about something else web-related.  Fortunately, there exist
a number of newsgroups about web-related stuff.  What's wrong with 'em?

-=Eric


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

Date: 27 Jul 1999 19:20:56 -0700
From: Sanford Morton <smorton@pobox.com>
Subject: Re: Can anyone explain concepts of Perl Objects?
Message-Id: <m3btcxzf93.fsf@pobox.com>

Have a look at
    http://www.speakeasy.org/~cgires/modules/objects/




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

Date: 27 Jul 1999 20:17:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Conversion Question??
Message-Id: <slrn7psmgo.3hu.abigail@alexandra.delanet.com>

Ivan Berg (iberg@montana.edu) wrote on MMCLVI September MCMXCIII in
<URL:news:7nlh33$fua$1@news.campuscwix.net>:
%% Anybody have an example of going from binary to decimal and vice versa??
%% 
%% The FAQ has examples but they don't seem to work at all
%% It seems to all have to do with pack and unpack??


I agree, the FAQ is incomplete on this subject. Knowing that on many
architectures, an unsigned char uses 8 bits, one can do:

      $decimal = unpack ("C", pack ("B8", "10110110"));


I try to avoid pack/unpack as much as I can. The documentation keeps
confusing me (3 out of 4 attempts doing something with pack/unpack
fail for me), and it all smells too low-level C-freakish and platform
dependent to me.


Perl 5.006 will know about binary numbers. (Will it have 'bin', to
accompany 'oct' and 'hex'?)



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 27 Jul 1999 19:25:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Conversion Question??
Message-Id: <379e5bf9@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, abigail@delanet.com writes:
:I agree, the FAQ is incomplete on this subject. 

Patches are always welcome. :-)

But I really thought that I'd managed to get these all explained.
Just a second...

Yup, there's bintodec() in perlfunc.  And printf %b goes the other way.

:I try to avoid pack/unpack as much as I can. The documentation keeps
:confusing me (3 out of 4 attempts doing something with pack/unpack
:fail for me), 

This only seems to byte me on using B/b or H/h.  Anything that pulls
you too close to vec() seems to lead too easily to confusion.

--tom, who meant to do that :-)
-- 
If I had only known, I would have been a locksmith.  --Albert Einstein


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

Date: Tue, 27 Jul 1999 21:40:15 -0400
From: "Tom Beauchamp" <acafounder@crosswinds.net>
Subject: Date?
Message-Id: <7nlmki$94c@nnrp3.farm.idt.net>

How can I get the current date into my perl script in numbers.  Like $day,
$month, and $year?  Is there any library that I could use that would let me
to date addition as well?

Tom Beauchamp

--


Visit the Tomb!
http://www.geocities.com/Area51/Shadowlands/3419/





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

Date: 27 Jul 1999 19:43:10 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Date?
Message-Id: <379e602e@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Tom Beauchamp" <acafounder@crosswinds.net> writes:
:How can I get the current date into my perl script in numbers.  Like $day,
:$month, and $year?  Is there any library that I could use that would let me
:to date addition as well?

% man perlfunc | tcgrep '\$(day|mon|year)'
                   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
               struct tm.  In particular this means that $mon has the range
               $year is the number of years since 1900, that is, $year is 123
                   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
               struct tm.  In particular this means that $mon has the range
               $year is the number of years since 1900, that is, $year is 123
% man perlfaq4 | tcgrep '\$(day|mon|year)'
           $day_of_year = (localtime(time()))[7];
           $day_of_year = localtime(time())->yday;
           $week_of_year = int($day_of_year / 7);

--tom
-- 
     There is always a better way.
                     -- Thomas Edison


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

Date: Tue, 27 Jul 1999 18:53:37 -0700
From: Zeng <zeng@haas.Berkeley.EDU>
Subject: DBM question
Message-Id: <Pine.SOL.4.05.9907271831220.5244-100000@haas.Berkeley.EDU>

I am trying to delete some records from an DBM. See the following code:

dbmopen REC, "rec", 0400 or die "..";

while (($Key, $Value) = each %REC)) {

  if ($Key eq "some special value here") {
        delete $REC{$Key};
  }
}

The code worked fine until I found a funny thing about it. That is, the
code cleaned only a fraction of all records which meets the criterion set
by the 'if' statement. If I keep running the code a few more times, the
job is done. (a specific example about what I am saying here: suppose the
$Key is somebody's name, $value is his/her age. Let's say we want to
delete records of which the name contains a string 'th'. ie. 
if ($Key =~ /th) {delete it}.  When I run this code, the first time I
deleted records with names like smith, wryth, etc, but some records
remains like names of judith, myth, etc. If I run the code again, or a
couple of more times, then all those names are gone. 

What is wrong here? One thing I speculate is that when I delete a record,
I somehow mess up the internal order of %REC, so the function 'each'
doesn't work the way I want.

Then I replaced the while loop by  

foreach $Key (keys %REC)

it seems working fine (though I am not absolutely sure since I only did
some experiments with it and the results look ok.)

BTW, I coded many different languages, but the perl, especially with the
DBM, produced results often contrary to what we think intuitively. anyone
has similar feelings?

Thanks.

Zeng



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

Date: Tue, 27 Jul 1999 22:39:16 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: DBM question
Message-Id: <379E6D53.F847C6A@rochester.rr.com>

> ...

> I am trying to delete some records from an DBM. See the following code:
>
> dbmopen REC, "rec", 0400 or die "..";
>

you mean dbmopen %REC,..., right?  Also, you opened the file for reading only
(the 0400), I assume that is also a typo?

>
> while (($Key, $Value) = each %REC)) {
>
>   if ($Key eq "some special value here") {
>         delete $REC{$Key};

from perlfunc regarding function each:

"... If you add
     or delete elements of a hash while you're iterating
     over it, you may get entries skipped or duplicated,
     so don't."

>
>   }
> }
>
> The code worked fine until I found a funny thing about it. That is, the
> code cleaned only a fraction of all records which meets the criterion set
> by the 'if' statement. If I keep running the code a few more times, the
> ...

like perlfunc says, don't do that.

> BTW, I coded many different languages, but the perl, especially with the
> DBM, produced results often contrary to what we think intuitively. anyone
> has similar feelings?

I have found that Perl does a better job of doing what the manual says it
should do than most other languages.  I have also found that what I
intuitively feel a language should do has nothing to do with what the
language actually does.
 ...



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

Date: Tue, 27 Jul 1999 21:34:39 -0500
From: "Norman Frech" <frech@primary.net>
Subject: Re: ebcdic packed numbers
Message-Id: <C0un3.86$Tw1.10834@news1.primary.net>

Thanks for the tips.  I will add another subroutine to my current convertor.
Norm

John G Dobnick wrote in message <7nksjo$k49$1@uwm.edu>...
>From article <7nkp7t$9jm$1@lublin.zrz.tu-berlin.de>, by
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
>> Norman Frech <frech@primary.net> wrote in comp.lang.perl.misc:
>>>I have a ebcdic to ascii converter that works well on everything but
packed
>>>numbers (signed and unsigned).  Does anyone have a tip or code that
converts
>>>this field type?
>>
>> I don't think ebcdic specifies anything like "packed numbers".  It's
>> a byte to character encoding, much like ascii, only sillier.  Explain
>> the data you want to convert a bit more.
>
>
> "Packed" numbers (which I presume really means "packed decimal" numbers)
> are not EBCDIC, ASCII, or any other character code.  They are
> binary coded decimal digits arranged in a specific manner.
>
> Each "byte" (8-bit byte in the IBM case) contains two 4-bit binary coded
> decimal digits.  The rightmost "nibble" (a "nibble" is a 4-bit quantity)
> contains the sign of the value.
>
>    decimal  binary  hexadecimal
>
>       0      0000    0
>       1      0001    1
>       2      0010    2
>       3      0011    3
>       4      0100    4
>       5      0101    5
>       6      0110    6
>       7      0111    7
>       8      0100    8
>       9      1001    9
>
>       +      1100    C
>       -      1101    D
>
>       +      1010    A    Alternative sign codes for ASCII mode, which
>       -      1011    B    is no longer used on IBM systems.
>
>       +      1111    F    treated as a "+" on input operands. "C" is
>                           the _official_ "+" sign code.
>
> So, the decimal number 123 would be represented in packed decimal
> as the two-byte quantity  12 3C (hex) or  00010010 00111100 (binary).
>
> -1234 would be 01 23 4D  (or 00000001 00100011 01001101).
>
>  "Translating" these values from ASCII <=> EBCDIC makes as much sense
>  as translating binary numbers from one character set to another;
>  namely none.  You either have to _know_ the record layout and copy
>  bytes accordingly, or (as someone else mentioned) have your data
>  source recreate the data using _only_ character codes -- no BCD or
>  binary fields.  (In COBOL terms, that means all fields in the record
>  are USAGE DISPLAY.)
>
>--
>John G Dobnick                          "Knowing how things work is the
basis
>Information & Media Technologies         for appreciation, and is thus a
>University of Wisconsin - Milwaukee      source of civilized delight."
>jgd@csd.uwm.edu   ATTnet: (414) 229-5727                    -- William
Safire
>




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

Date: 27 Jul 1999 20:06:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <slrn7pslsg.3hu.abigail@alexandra.delanet.com>

revjack (revjack@radix.net) wrote on MMCLVII September MCMXCIII in
<URL:news:7nlhmb$a5e$1@news1.Radix.Net>:
== Abigail explains it all:
== 
== :I'd write an entry for the FAQ on this topic, if I would ever use code
== :to find out the size of an image - however, I always know the size of
== :the image before I make it, so why should I want to find out afterwards?
== 
== To find out the size of other people's images? I recently wrote a small
== application that allows our intranet users to upload banner ads to our
== websites. Determining the height and width of the uploaded image allows
== the app to write out the proper HTML code to the target web page.


Banner ads are evil, and HTML browsers can figure out the sizes of
images very well. ;-)



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 27 Jul 1999 19:07:20 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <379e57c8@cs.colorado.edu>
Keywords: Hexapodia as the key insight

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    revjack <revjack@radix.net> writes:
:To find out the size of other people's images? I recently wrote a small
:application that allows our intranet users to upload banner ads to our
:websites. Determining the height and width of the uploaded image allows
:the app to write out the proper HTML code to the target web page.

Translation courtesy of one of the contest entries submitted for
http://language.perl.com/misc/geekspeak.html

    To find out the size of other people's images? I recently wrote a
    small program that allows our internal network users to transfer
    eye trash to our websites. Determining the height and width of the
    transferred image allows the program to write out the proper MS-HTML
    code to the target HTTP-accessible page.

Ah, that makes much more sense now. :-)

--tom
-- 
Annex Canada now!  We need the room, and who's going to stop us?
	--A Tom Neff .signature


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

Date: 28 Jul 1999 02:03:23 GMT
From: revjack <revjack@radix.net>
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <7nlodb$m1d$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Tom Christiansen explains it all:

:Translation courtesy of one of the contest entries submitted for
:http://language.perl.com/misc/geekspeak.html

:    To find out the size of other people's images? I recently wrote a
:    small program that allows our internal network users to transfer
:    eye trash to our websites. Determining the height and width of the
:    transferred image allows the program to write out the proper MS-HTML
:    code to the target HTTP-accessible page.

:Ah, that makes much more sense now. :-)

Thanks. I would add:

size = bandwidth

erk


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

Date: 28 Jul 1999 02:08:42 GMT
From: revjack <revjack@radix.net>
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <7nlona$m1d$2@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Abigail explains it all:

:Banner ads are evil, and HTML browsers can figure out the sizes of
:images very well. ;-)

Off topic: It gets worse. We got an offer to host a Macromedia Flash ad
banner today. I am not making this up. 

[Followup-To: comp.infosystems.www.authoring.html]


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

Date: Wed, 28 Jul 1999 02:34:17 GMT
From: wasteNOSPAMbasket@bigfoot.com (Jamie Jackson)
Subject: Has Perl been Ported to the Palm Pilot OS?       passme
Message-Id: <379f6b55.175399411@news.erols.com>

Does anyone know if this is possible/impossible/being attempted, etc.?
Thanks

Jamie Jackson 
(remove the obvious to reply)



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

Date: 28 Jul 1999 02:18:20 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: negated compiled regexp
Message-Id: <7nlp9c$oqb$1@rguxd.viasystems.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:>    lee.lindley@viasystems.com writes:
:>:So, how to compose a re that is a negated re?  

:>I just posted this.  It's in the Cookbook.  Here's the short answer:

:>    /^(?:(?!PAT).)*$/s

Thanks Tom,

Since Deja keyword seaches don't seem to let you quote pattern
matching chars like '?' and '^', it took some effort to find the post
you mentioned.  Before posting I had looked on Deja with

regular expression (negated|negating) 

when I should have just used "regex* negat*".  There may be a language
lesson in that -- root words and common abbreviations.  :-)

I had also skimmed chapter 6 of the Cookbook, and didn't see this,
but since you wrote it I'll take your word for it that it is there.
:-) The Cookbook is at work tonight and I am not.

There are too many things going on with this re that are not
immediately obvious to me.

Whether or not the ^..$ anchors are necessary (I suspect they are).
The grouping of the assertion with a '.' (Have to match something).
The one that really has me spinning is the 0 or more '*' in that thing.
I would have guessed '+'.

Lets try it.  From perl debugger:
  DB<3> $rex=qr/^(?:(?!PAT).)*$/
  DB<4> $val = ''
  DB<5> print "true" if ($val =~ $rex)
true	# So far so good
  DB<6> $val='PAT'
  DB<7> print "true" if ($val =~ $rex)
true

Ahh Ohh.  What am I missing?  That one through me.
I'll try it my way:

  DB<2> $rex=qr/^(?:(?!PAT).)+$/
  DB<3> $val='PAT'
  DB<4> print 'true' if ($val =~ $rex)
true
  DB<5> $val='/PATH'
  DB<6> print 'true' if ($val =~ $rex)

  DB<7> $val='/PAT'
  DB<8> print 'true' if ($val =~ $rex)
true
  DB<9> $val='PATH'
  DB<10> print 'true' if ($val =~ $rex)

  DB<11>

Looks like I have some boundary condition issues here.  I'll try the
recommended way again:

  DB<3> $rex = qr/^(?:(?!PAT).)*$/
  DB<4> $val = 'PAT'
  DB<5> print 'true' if ($val =~ $rex)
true
  DB<6> $val = '/PAT'
  DB<7> print 'true' if ($val =~ $rex)
true
  DB<8> $val = '/PATH'
  DB<9> print 'true' if ($val =~ $rex)

  DB<10> $val = 'PATH'
  DB<11> print 'true' if ($val =~ $rex)

  DB<12>


It is too late in the evening for me to completely wrap this up.  But
I think your short answer is too short.  This is not enough
information to construct the general case of a negated regular
expression.  Use of the negative lookahead assertion to do this seems
to preclude a match with a re that would match the entire string
(which makes sense).  I'll work on it tommorrow if somebody doesn't
explain it all before then.

But consider that with the introduction of compiled regular
expressions, there may be some need for a more general "negated"
operator for regular expressions..  The traditional use of "!~" vs.
"=~" is no longer adequate unless you can apply the logic to the
compiled version.


-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.
And like 50 cent beers, the quality is sometimes lacking.


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

Date: Wed, 28 Jul 1999 12:53:22 +1000
From: "Niclas Wendel" <N.Wendel@mailbox.gu.edu.au>
Subject: Newbie needs help to connect to MS Access
Message-Id: <7nlrbe$sjm$1@kraken.itc.gu.edu.au>

Hi there,

I need some help to get started.
I'm working on an application that has to extract some data from an Access
DB.

What sort of drivers do I need to get? Are there any free trial ones?
How do I connect to the DB?

All hints and tips are appreciated.
TIA,
Nick :o)





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

Date: Wed, 28 Jul 1999 01:56:26 GMT
From: Carfield Yim <c8133594@comp.polyu.edu.hk>
Subject: Re: Pass by value or pass by reference?
Message-Id: <7nlo07$2l5$1@nnrp1.deja.com>

Thank for reply!!

I know that perldoc is a great reference, but I don't know how to find
the information I want, e.g.: If I want to find information about
[return], How do I know perlfunc contain information of it?
The only way is asking people at web? I think there should have some
document can help me.

I think that the main problem is I don't know most of the perl index
definition.

Now I only know that perlmol is something about package, doing thing
that like to <include> in C, and perlref is something about reference,
perlobj is something about object in perl.

But the manual contain some topic like perlguts and perlpod, I don't
know what are they.

In article <379DDDD7.93C2D3C6@mindspring.com>,
  keithmur@mindspring.com wrote:
> Carfield Yim wrote:
> >
> > I am new to perl, if you find this is a easy question, please tell
me
> > where can I find solution.
> >
> > When I pass an object as parameter to a function, or return an
object
> > from a function,
> > i.e.: return ($rv);
> >       db_write ($dbh);
> >
> > is these operation pass the value (copy) or pass the reference
(link)?
> >
> perldoc perlsub:
>
> "Any arguments passed to the routine come in as the array @_. Thus if
> you called a function with two arguments,
> those would be stored in $_[0] and $_[1]. The array @_ is a local
array,
> but its elements are aliases for the
> actual scalar parameters. In particular, if an element $_[0] is
updated,
> the corresponding argument is updated (or
> an error occurs if it is not updatable). "
>
> Sounds more like reference than value to me...
>
> As for return, it pretty much *has* to return a value, if you think
> about it.  Or even just do:
>
> perldoc perlfunc
>
> and look for 'return'.
>
> Perldoc is your friend.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 28 Jul 1999 02:50:43 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Anonymity Question (gulp!)
Message-Id: <7eun3.150$BK.7933@nsw.nnrp.telstra.net>

In article <oFnn3.84$uO1.7590@news.enterprise.net>,
	"Simmo" <simsi@hotmail.com.nospam> writes:

> Ok, i know this group can be a bit, ahem, *sensitive* to issues of anonymity
> but it's a straight up project i'm doing where i have been asked by an
> organisation if i can increase traffic to a site over a short but defined
> period to effectively stress test the build, but due to politics (I'm
> agency, webmaster/configurator  isn't), i need to change the IP address/host
> of the Perl script calling the headers each visit.....is there a way to do
> this with Perl?

I have read this 3 times, and I am still having a hard time
understanding what you mean...

Is your question:

I have an HTTP client program, written in Perl, which contacts a HTTP
server, and requests a document (or just the headers for a document).
Is it possible to make the request appear (to the server) to come from
a different IP address on each request?

If that is your question, the answer is: Not easily. You can very
likely make it appear to come from any of the IP addresses that your
client runs on. If the machine that it runs on has multiple IP
addresses, you probably can use all of them. You could spoof any IP
address, but if you expect a reponse, and if you want the transactions
to complete, you can't use spoofing. Even writing a client that uses a
different, but actual, IP address from the current machine's default
is not trivial. 

TCP/IP was designed for reliability, not for marketing.

You could try asking in comp.protocols.tcpip or something like that.
They might know a few tricks to do this, which you then possibly can
translate in perl. 

If it's just for marketing purposes, why don't they just fake a log
file? Much easier.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Tue, 27 Jul 1999 22:02:09 -0400
From: "Tom Beauchamp" <acafounder@crosswinds.net>
Subject: print problem
Message-Id: <7nlntk$9if@nnrp3.farm.idt.net>

How can I include quotes in a perl print statement.  Say I want to output
this in my script:

<font face="Arial, Helvetica, sans-serif">Whatever</font>

I tried \" and "" but they didn't seem to work.

Tom Beauchamp

--


Visit the Tomb!
http://www.geocities.com/Area51/Shadowlands/3419/





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

Date: 28 Jul 1999 02:41:43 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: print problem
Message-Id: <slrn7psn8n.hc.sjs@frisco.gulch.com>

Tom Beauchamp <acafounder@crosswinds.net> wrote:
=How can I include quotes in a perl print statement.

Try: man perlop.  Then search for the first "quotes".

Here's part of that lovingly handcrafted documentation:

++++++
Customary  Generic
    ''       q{}
    ""      qq{}
++++++

For ex:
perl -we 'print qq{always scour the "docs" first\n}'

Steve


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

Date: Wed, 28 Jul 1999 01:09:39 GMT
From: Jewell Anderson <jewell.anderson@mciworld.com>
Subject: Retrieving News by message_id using net::NNTP
Message-Id: <379E5903.944D6FF8@mciworld.com>

  Referencing the book Perl Cookbook, I'm trying to get the following
short example to work, but I'm receiving one blank line within the
@lines array.  Any suggestions:

#! /opt/local/bin/perl
use Net::NNTP;
$server = Net::NNTP->new("news.mciworld.com")
     or die "Can't open news server: $@\n";
$message_id = "<Linm3.225$%L2.32094\@PM01NEWS>";
@lines = $server->article($message_id)
    or die "can't fetch article $message_id: $!\n";
foreach $line (@lines)
{    print "$line\n";
}

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

My ultimate goal is to retrieve all the news groups on a news server
with a particular message_id.

                                               -Jewell Anderson





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

Date: Tue, 27 Jul 1999 18:03:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Trouble with sort
Message-Id: <MPG.1207f69dc907e088989d5b@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7nlcsb$ric$1@nnrp1.deja.com> on Tue, 27 Jul 1999 22:46:36 
GMT, mike_lottridge@mentorg.com <mike_lottridge@mentorg.com> says...
+ I'm having trouble with sort and a custom sorting routine. It looks
+ like my sort routine is being called with the same data over and over.
+ I assume it's some sort of reference problem. I looked through the 
FAQ,
+ I know this isn't the most efficient method, but I don't anticipate
+ needed to sort a large amount of data. I'm using ActiveState Build 
518.
+ 
+ Here's the code:
+ ------------------
+ use Date::Manip;
+ 
+ sub DateSort {
+    print "DateSort:\n$a\n$b\n";
+ 
+    my $date1=&ParseDate($a);
+    my $date2=&ParseDate($b);

I tried replacing these with simple copy and substition, and it worked 
fine.  So the problem must be in ParseDate.

+    print "Comparing $date1 to $date2 \n";
+ 
+    if ($date1 lt $date2) {
+    	return -1; # date1 is earlier
+    }
+    elsif ($date1 gt $date2) {
+     	return 1;# date2 is earlier
+    }
+    else {
+ 	return 0;
+    }# the two dates are identical)

I also replaced the above 9 lines by this:

     $date1 cmp $date2
 
+ }
+ 
+ $TZ="pst";
+ 
+ @dates=("01/12/99", "06/12/98", "01/01/00", "04/01/90");

I hope ParseDate deals properly with your Y2K problem!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 27 Jul 1999 18:30:34 -0700
From: Kin Lum <kin@0011.com>
Subject: Re: why perl?
Message-Id: <379E5D3A.58D2EB4E@0011.com>

Easy to learn.  Highly portable.  Rapid development.
Lot of useful packages.

Something that needs to be written in C in days can be written
in Perl in hours.  C, in hours; Perl, in minutes.

Many books have excellent coverage on Perl:
http://www.0011.com/books/perl


destaria wrote:
> 
> How easy and worthwhile might it be for me to pick up perl? Like, say
> if I had a year to go at it (part-time), what might I expect to be able
> to do with it? I learn fairly quickly, given incentive.
> 
> I know some c and c++ (an ongoing commitment), and a smattering of
> other things (java & asm), but am at a bit of a loss as to programming
> for the net. I don't really know enough about the inner workings of the
> internet yet, so maybe I need to study that area first.
> 
> I like the look and feel of perl, so far. Is it the way to go do you
> think?
> 
> Thanks in advance for any advice. :)
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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


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