[19286] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1481 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 9 21:10:40 2001

Date: Thu, 9 Aug 2001 18: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: <997405816-v10-i1481@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 9 Aug 2001     Volume: 10 Number: 1481

Today's topics:
    Re: For loop aliasing?? <twebb@collabrasoft.net>
    Re: From UNIX to Windows <goldbb2@earthlink.net>
        looking for script to edit config variables <projectobjects@earthlink.net>
        NET::SSH, NET::FTP, NET::POP3 (how to detect) <wcrites@cis.ctc.edu>
    Re: Not matching strings <ren@tivoli.com>
    Re: Parsing a HTML page <brentdax1@earthlink.net>
    Re: Perl 5.6 Pollute <eric@mizuhocap.com>
    Re: perl to database <bwalton@rochester.rr.com>
    Re: permuting extremely large string <krahnj@acm.org>
    Re: q: converting strings <jurgenex@hotmail.com>
    Re: Sub that defaults to use $_ in callers context <brentdax1@earthlink.net>
    Re: traversing sub-directories (Tad McClellan)
    Re: Understanding parsers <goldbb2@earthlink.net>
        Useragent Posting help (greg)
    Re: Why is $i so popular? (Mark Jason Dominus)
        XS: ExtUtils/typemap T_IN refcount bug? <joe+usenet@sunstarsys.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 09 Aug 2001 23:18:18 GMT
From: "Trey Webb" <twebb@collabrasoft.net>
Subject: Re: For loop aliasing??
Message-Id: <_SEc7.527$5T6.109984@typhoon2.gnilink.net>

An alias is not the same as a reference. Aliases are just that, another name
for a variable. Aliases do not need to be dereferenced as references do. The
loop variable in a foreach variable is aliased either lexically or
dynamically to each element of the array(s) or hash(es) as the loop -- well,
loops. Any modification of that variable does affect the array or hash
element. Aliases are used instead of references here for speed concernces
(an alias is faster than a reference, but sometimes a little trickier). If
the variable was defined in earlier code with 'my' then it is lexically
scoped meaning subs called from the routine can not see the variable unless
it is passed in. Otherwise it is dynamically scoped meaning the previous
value is squirreled away and returned when the loop is exited. Yes, $_ will
be the target, unless you specify another target with =~ or !~. Perl will
only use the contents of a scalar ($x) as a variable name (symbolic
reference) if you try to dereference it when it is not a reference and you
do not use"' use strict 'refs' ".

For references the Perl Documentation perlref doc and the book Advanced Perl
Programming are great.

Hope this helps.

--trey


"Jeff" <jeff_haralson@qwest.net> wrote in message
news:4X4c7.3194$87.438823@news.uswest.net...
>
> "Carlos C. Gonzalez" <miscellaneousemail@yahoo.com> wrote in message
> news:MPG.15da70323bf95606989717@news.edmonton.telusplanet.net...
> > Hi everyone,
> >
> > I have been reading through various documents online including perldoc
> > stuff and am having a hard time finding what I need to know.  Can
someone
> > explain something to me.
> >
> > Given the code snippet below...
> >
> > for ($string) {
> >   s/^\s+//; # ^ anchor to beginning, \s space, + multiple spaces,
replace
> > with nothing.
> >   s/\s+$//; # $ anchor to end, replace with nothing.
> > }
> >
> > I believe I can rewrite it like this...
> >
> > $string =~ s/^\s+//;
> > $string =~ s/\s+$//;
> >
> > What I don't understand is the aliasing that is occuring inside the for
> > loop.  Does the scalar $string get assigned to the $_ implied variable
> > and then does this $_ variable become the target of each regular
> > expression?
> >
> > Can someone recommend a good link somewhere on aliasing and what happens
> > and when underneath code like above.  I have been looking and reading
and
> > searching and searching but it's like looking for a needle in a
haystack.
> >
> > Thanks.
> >
> > ---
> > Carlos
> > www.internetsuccess.ca
> >
>
> the construct (  ) is an array like ( 1,2,3,4 ) is an array containing 4
> items.  In your example you have an array with one item ($string)
> Typically you see a for loop written
>
> for $string (@strings)
> {
>    $string =~ s/^\s+//;
>    $string =~ s/\s+$//;
> }
>
> In this case $string gets a reference to each item in @strings
>
> In the absence of "$string" in my loop the for loop would assign $_ a
> reference to each item in the array.  References are something like
pointers
> in C.  They allow you to directly manipulate the items in the array
without
> doing the reassignment suffle you describe above. Unlike C pointers,
> references have some loose rule especially when you have not set the
pragma
> 'use strict ref'.  Perl will attempt to use the value stored in a scalar
> "$variable" as the name of a real variable if you have not set 'use strict
> ref'.  If you search for references and read up you'll get the picture.
>
> Jeff
>
>




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

Date: Thu, 09 Aug 2001 19:05:02 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: From UNIX to Windows
Message-Id: <3B73171E.E164A8BE@earthlink.net>

Steve Postlewait wrote:
> 
> I've written a number of scripts that run fine on a UNIX machine, but
> now I need to move somethings to Windows, which is using ActivePerl.
> 
> From a prompt I type: perl hello.cgi  and I get the standard .html
> code, including my <H1>Hellow World</H1> line. This seems to tell me
> that Perl is working.

You should also get an http header first.

> When I enter the URL on a browser however ... nothing happens.  Well
> actually, I get the "Connect: www.xxxx.com connected. Waiting for
> reply" on the status bar at the bottom.

Your browser reads the one line output "<H1>Hellow World</H1>" and
thinks it's the first line of the http header.  It then looks for a
blank line which marks the end of the http headers and the beginning of
the html document.  It doesn't find that blank line, and keeps waiting.

> In other words my Hello World never appears on the browser.
> 
> I've tried using #!perl rather than the UNIX #!/usr/local/bin/perl ...
> but that may have nothng to do with the problem.
> 
> Any suggestions?

try this code:
#!/usr/local/bin/perl -wT
use strict;
use CGI;

print header, begin_html;
print "<H1>Hellow World</H1>";
print end_html;
__END__

-- 
I need more taglines. This one is getting old.


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

Date: Fri, 10 Aug 2001 00:08:39 GMT
From: "Dale Henderson" <projectobjects@earthlink.net>
Subject: looking for script to edit config variables
Message-Id: <bCFc7.1556$2M3.137107@newsread1.prod.itd.earthlink.net>

Looking for module or open source script that can edit config variables from
a file in the following format -

$varname = "value";

any replies welcome,
dale




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

Date: Thu, 09 Aug 2001 16:06:54 -0700
From: William Crites <wcrites@cis.ctc.edu>
Subject: NET::SSH, NET::FTP, NET::POP3 (how to detect)
Message-Id: <3B73178D.8A7D5522@cis.ctc.edu>

I want to know how to detect the service/activity/status that has SSH,
FTP, POP3 remotely. It is for monitoring purpose that I want to make
sure they are up instead down.   One major problem I have, I don't want
to use account or authentication in my own program.

Please reply back email back to me too in case because I plan to taking
a week vacation starts Saturday.

Thanks
NT Admin
Wm. Crites



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

Date: 09 Aug 2001 15:37:34 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Not matching strings
Message-Id: <m3zo99as1d.fsf@dhcp9-161.support.tivoli.com>

On 9 Aug 2001, grunge12345@hotmail.com wrote:

[snip]

> so thanks to nobull and Ren.

You're welcome.

> Possibly the guy who had a problem with my initial code:
>     if ($string =~ /^(?:(?!PAT)|.)*$/) {
>         print "hi\n";
>     }

I still say that matches all strings (well, without embedded
newlines).  Alternating a negative look-ahead with "." is really just
the same as "." by itself.  Take the "|" out and it is a different
story.

> had trailing carriage returns. You can fix this by adding an s qualifier
> to the end of the RE as in:
>     if ($string =~ /^(?:(?!PAT)|.)*$/s) {
>         print "hi\n";
>     }

Now it even matches strings with embedded newlines.  Again, take out
the "|" and you have something that works.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 09 Aug 2001 23:07:42 GMT
From: "Brent Dax" <brentdax1@earthlink.net>
Subject: Re: Parsing a HTML page
Message-Id: <2JEc7.1367$q46.117273@newsread2.prod.itd.earthlink.net>

"Peter Mann" <Pcmann1@btinternet.com> wrote in message
news:9ku30p$jfu$1@uranium.btinternet.com...
> Dear all,
>
> I am writing a program that parses a html pages and extracts links and
> performs validation of these links and generally reports the properties of
> the page. However, I was wondering if there is any module avaialble to
help
> determine any embedded technologies within the html page such as
javascript,
> php, VBscript etc.
> I need to automatically compile a report describing all relevant
properties
> of a particular html page.

The CPAN has many HTML-related modules available; try search.cpan.org.

--Brent Dax
brentdax1@earthlink.net




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

Date: Thu, 09 Aug 2001 18:09:31 -0400
From: Eric <eric@mizuhocap.com>
To: Brent Dax <brentdax1@earthlink.net>
Subject: Re: Perl 5.6 Pollute
Message-Id: <3B730A1B.9D7DEB4@mizuhocap.com>

:-)
Brent,
That's actually a great idea and if no one comes up with
an alternative it's what I'm going to do.
Thanks for the suggestion and the laugh.

-Eric


Brent Dax wrote:

> "Eric" <eric@mizuhocap.com> wrote in message
> news:3B72EAF0.E66175FF@mizuhocap.com...
> > Does anyone know of a way to enable the POLLUTE option in perl 5.6 on a
> > one off basis ( a switch perhaps ),  rather then having to recompile the
> > whole thing and forcing this environment POLLUTION in all cases?
>
> I don't believe there's a way to do that.  You could compile two versions of
> Perl (/usr/bin/perl and /usr/bin/perl-superfund?) and just make sure you
> call the right one when you need pollution.
>
> (However, I could be wrong.)
>
> --Brent Dax
> brentdax1@earthlink.net



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

Date: Fri, 10 Aug 2001 00:42:06 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: perl to database
Message-Id: <3B732E24.46BCBFA8@rochester.rr.com>

"R.Vic" wrote:
> 
> I'm trying to create a script thas trasfer data to an access database.
> 
> I'm trying to use win32:odbc, but can't get it to work.

Maybe if you tried Win32::ODBC?

> 
> To create an system dsn, do I need an sql server software?
> 
> Can this be done with MYSQL?

Well, a system DSN won't be very useful without a database of some kind
to hook it up to.  In addition, note:  you would be better off with

    use DBI;

than with Win32::ODBC.  DBI will connect to any database on any system,
not just ODBC sources on Windoze.  With DBI, you can use plain CSV text
files as an SQL database (DBD::CSV), or even generate an SQL database in
RAM memory without the need for a file at all (DBD::RAM).  And in doing
all that, the only thing that changes in your program is the connect
string.  Your code otherwise stays the same even if you move it to a
different platform.  Plus DBI is Perl's standard method of dealing with
SQL databases.  It makes it possible to learn about and test out SQL
without hassling around with actually installing and getting a database
program to work.  Great stuff!
-- 
Bob Walton


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

Date: Fri, 10 Aug 2001 00:50:13 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: permuting extremely large string
Message-Id: <3B732FC4.549F9E64@acm.org>

Les Ander wrote:
> 
> Hi,
> i need to permute a string which is about 4 Mb!
> I experience  memory problems if i convert it to an array (the program
> crashes). So I need to permute the string inplace without converting
> it into an array.
> A simple strategy i am thinking of is follows...
> 
> sub perm_string
> {
>   my $str_ref=shift @_;
>   my $len=length $$str_ref;
>   for (1..1000){
>      my $start=int rand($len-1);
>      my $size=int rand($len-$start-1);
>      my $temp_str=substr($$str_ref, $start,$size);
>      substr($$str_ref, $start, $size)='';
>      $$str_ref.=$temp_str;
>   }
> }
> 
> it took about 45 seconds when i tried it on a string of length about
> 5,000,0000 characters.
> Is there a way to speed it up?
> also, can some one think of a better algorithm?

I don't know if this is faster but it's shorter.

sub perm_string {
    my $str_ref = shift;
    my $len = length $$str_ref;
    for ( 1 .. 1000 ) {
        my $start = int rand( $len - 1 );
        my $size = int rand( $len - $start - 1 );
        # if you want the string you removed at the end of $$str_ref
        substr( $$str_ref, $len - $size, 0 ) = substr( $$str_ref,
$start, $size, '' );

# if you want the string you removed at the beginning of $$str_ref
#       substr( $$str_ref, 0, 0 ) = substr( $$str_ref, $start, $size, ''
);
        }
    }



John
-- 
use Perl;
program
fulfillment


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

Date: Thu, 9 Aug 2001 18:04:12 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: q: converting strings
Message-Id: <3b73330d@news.microsoft.com>

"Jasper McCrea" <jasper@guideguide.com> wrote in message
news:3B72B318.B92E3A7C@guideguide.com...
> "John W. Krahn" wrote:
> > Jasper McCrea wrote:
> > > I suggest that 'twelve' looks like a number, and you disagree. I find
> > > that extremely odd.
> > It looks like a _word_ to me.
> 12
> That looks like two arabic symbols set side by side.
>
> To say that a word representation of a number looks any less like a
> number than the arabic representation of the same number is nonsense.

May I ask a question: is "Dutzend" a number, too? Or "Schock" for that
matter?

Let's just recall some CS basics.
The number "12" itself is an abstract idea. And only the abstract idea is
the number!
Anything else, be it "12", "twelve", "zwölf", or "dozen" are merely
representations for the abstract idea of the number 12. Crutches we mere
mortals need to communicate with each other.

In so far neither the arabic representation nor the English word in Roman
letter is a number.

However, in daily reality it turned out that using a normal form simplifies
matters quite a bit. And therefore people agreed to consider the arabic
representation as number, while representations in Roman letters (or others)
or usually considered words.

jue






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

Date: Fri, 10 Aug 2001 00:48:15 GMT
From: "Brent Dax" <brentdax1@earthlink.net>
Subject: Re: Sub that defaults to use $_ in callers context
Message-Id: <jbGc7.1620$q46.118776@newsread2.prod.itd.earthlink.net>

"Yves Orton" <demerphq@hotmail.com> wrote in message
news:74f348f7.0108091013.35ab561c@posting.google.com...
> Bjoern Hoehrmann <bjoern@hoehrmann.de> wrote in message
news:<3c02906c.71455277@news.bjoern.hoehrmann.de>...
> > * Yves Orton wrote in comp.lang.perl.misc:
> > >Just curious if anyone knows how to get access to the callers $_
> >
> > As
> >
> >   % perl -wmstrict -MData::Dumper -e "
> >       sub x { print Dumper [ \@_, [caller], [\%::]] } sub t { x } t 10"
> >
> > kindly demonstrates, you don't have access to the callers $_ unless you
> > pass it to the called sub routine or store it somewhere where the sub
> > routine has access to it.
> >
> > But maybe I misunderstood your question...
>
> Im not sure if you did or did not understand the question, as Im not
> sure if  understand your answer.  :-)
>
> Am I correct in thinking that %:: is the symbol table for main?

Yes, you are.

> And what does this part of the output mean:
>               '_' => *::_,
> Is that not the $_ or is that a different $_

*_ is a magical thingy called a typeglob; it holds $_, @_, %_, &_, iohandle
_ and format _.  Only globals have typeglobs; thus, this means that all the
(symbol)_ variables are globals, so there's nothing stopping you from
getting them.

There are conditions where 'foo' won't match up with *::foo; for instance,
if MyModule uses Exporter to export the foo routine to you, you might see
'foo' => *MyModule::foo.  (I'm not quite sure about this, however.)  Between
the %packagename:: hash and typeglobs, you can do all sorts of interesting
things; for example, I once wrote a program which read itself in, changed
all the variable names, and spat out a new version of itself with random
variable names.

    #$prog contains the code of this program
    for(keys %::) {
        next if $_ eq '_';    #$_ is special

$temp=chr(rand(26)+ord('a')).chr(rand(26)+ord('a')).chr(rand(26)+ord('a'));
        $prog =~ s/$_/$temp/g;
    }
    print $prog;

    This might print out a segment like this:
    #$abc contains the code of this program
    for(keys %::) {
        next if $_ eq '_';    #$_ is special

$xyz=chr(rand(26)+ord('a')).chr(rand(26)+ord('a')).chr(rand(26)+ord('a'));
        $abc =~ s/$_/$xyz/g;
    }
    print $abc;

(Yes, that program was entirely pointless; however, writing it was more
entertaining than listening to my AP CompSci teacher lecture.)

HTH,
--Brent Dax
brentdax1@earthlink.net




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

Date: Thu, 9 Aug 2001 18:40:13 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: traversing sub-directories
Message-Id: <slrn9n64ad.sqb.tadmc@tadmc26.august.net>

Chuck Goldstein <chuckmg@acm.org> wrote:

>Am new to Perl.  An old (more ways than one) awk-user.


Note that installed along with perl itself is a program
named "a2p" (awk to perl) that translates awk code into Perl.

So when you know how to do it in awk, a2p can show you how
to do it in Perl.


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


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

Date: Thu, 09 Aug 2001 18:55:15 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Understanding parsers
Message-Id: <3B7314D3.C696CA21@earthlink.net>

#!/usr/bin/perl -w
use strict;
use HTML::Parser;

use base q(HTML::Parser);

my @counters = (
	['A' .. 'Z'], [1 .. 100], ['a' .. 'z'], 0,
	[ qw/i ii iii iv v vi vii viii ix x xi xii xiii xiv
	    xv xvi xvii xviii xix xx xxi xxii xxiii xxiv xv/ ],
)l
@counter[3,5,6] = @counters[1,4,2];

my ($anchor, @level, $ul_depth, $ol_depth) = ("", 0);
my $section_4;
sub start {
	my($self, $tagname, $attr, $attrseq, $origtext) = @_;
	print $origtext and return if !$section4;
	if( $tagname eq "ul" && !$ol_depth ) {
		++$ul_depth;
	} elsif( $tagname eq "ol" && !$ul_depth) {
		if( $ol_depth || keys %$attr ) {
			++$ol_depth;
		} elsif(@level == 1) {
			$anchor = $counters[$level[0]++];
			push @level, 0;
		} else {
			$anchor .= "." . $counters[$level[-1]];
			push @level, 0;
		}
	}
	print $origtext;
	if( $tagname eq "li" && !$ol_depth && !$ul_depth ) {
		print qq{<A NAME="$anchor.$counters[$level[-1]++]">};
	}
}

sub end {
	my($self, $tagname, $origtext) = @_;
	print $origtext and return if !$section4;
	if( $tagname eq "ul" && !$ol_depth ) {
		--$ul_depth;
	} elsif( $tagname eq "ol" && !$ul_depth ) {
		if( $ol_depth ) {
			--$ol_depth;
		} else {
			$anchor =~ s/\..*?$// or $anchor = "";
			pop @level;
		}
	}
	print $origtext;
}

sub text {
	my($self, $origtext, $is_cdata) = @_;
	if( $origtext =~ /<h2>Section IV\./ ) {
		$section4 = 1;
	}
	print $origtext;
}

main->new->parse_file("foo.html");

__END__

I assume that the toplevel html contains multiple ordered lists, but
each list item contains at most one ordered sub-list.  We ignore all
lists within unordered lists, we ignore all lists within 'special'
ordered lists.

-- 
I need more taglines. This one is getting old.


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

Date: 9 Aug 2001 15:41:39 -0700
From: benz@op.net (greg)
Subject: Useragent Posting help
Message-Id: <9476bc21.0108091441.1d624f8c@posting.google.com>

How could i simulate the form below and get the result to display on
my page.  What would the code look like using useragent?  I must be
doing this wrong, because when I try it gives me hertz's error page
instead of the search results.

<FORM ACTION="https://www2.hertz.com/InteractiveRes/secure/ISNIWEBB.EXE?U+CK+ONLINE+G:310/"
METHOD="POST" TARGET="body">
<INPUT TYPE="HIDDEN" NAME="Pickup_Location"
VALUE="USPA$airportcode01">
<INPUT TYPE="HIDDEN" NAME="Pickup_Oag" VALUE="$airportcode   ">
<INPUT TYPE="HIDDEN" NAME="Return_Location"
VALUE="USPA$airportcode01">
<INPUT TYPE="HIDDEN" NAME="Return_Oag" VALUE="$airportcode   ">
<INPUT TYPE="HIDDEN" NAME="Ct_Of_Residence" VALUE="$countrycode">
<INPUT TYPE="HIDDEN" NAME="Pickup_Month" VALUE="$pumonth">
<INPUT TYPE="HIDDEN" NAME="Pickup_Day" VALUE="$hpickupday">
<INPUT TYPE="HIDDEN" NAME="Pickup_Year" VALUE="2001">
<INPUT TYPE="HIDDEN" NAME="Return_Month" VALUE="$month">
<INPUT TYPE="HIDDEN" NAME="Return_Day" VALUE="$hdropoffday">
<INPUT TYPE="HIDDEN" NAME="Return_Year" VALUE="2001">
<INPUT TYPE="HIDDEN" NAME="Pickup_Hour" VALUE="$hertzputime">
<INPUT TYPE="HIDDEN" NAME="Pickup_Minute" VALUE="00">
<INPUT TYPE="HIDDEN" NAME="Pickup_Am_Pm" VALUE="$dollarpickuptime     
">
<INPUT TYPE="HIDDEN" NAME="Return_Hour" VALUE="$hertzdotime">
<INPUT TYPE="HIDDEN" NAME="Return_Minute" VALUE="00">
<INPUT TYPE="HIDDEN" NAME="Return_Am_Pm" VALUE="$dollardropofftime    
 ">
<INPUT TYPE="HIDDEN" NAME="Airline" VALUE="WALK">
<INPUT TYPE="HIDDEN" NAME="Flight_Number" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Car_Color" VALUE="C91807316D24312-24">
<INPUT TYPE="HIDDEN" NAME="Ext_Cp_Code" VALUE="NRNT">
<INPUT TYPE="HIDDEN" NAME="Ext_Cd" VALUE="1219842">
<INPUT TYPE="HIDDEN" NAME="Ext_Ft" VALUE="Y">
<INPUT TYPE="HIDDEN" NAME="Ext_Ht" VALUE="Y">
<INPUT TYPE="HIDDEN" NAME="Ext_Sl_Path" VALUE="F">
<INPUT TYPE="HIDDEN" NAME="Ext_Links" VALUE="N">
<INPUT TYPE="HIDDEN" NAME="Trav_Radio_Buttons" VALUE="B">
<INPUT TYPE="HIDDEN" NAME="Phone_Number" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Email_Address" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Corp_Discount" VALUE="0001219842">
<INPUT TYPE="HIDDEN" NAME="Company_Auth_Nbr" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Trav_Radio_Buttons" VALUE="L">
<INPUT TYPE="HIDDEN" NAME="Freq_Traveller" VALUE="NUN">
<INPUT TYPE="HIDDEN" NAME="Ft_Number" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Freq_Guest" VALUE="NUN">
<INPUT TYPE="HIDDEN" NAME="Fg_Number" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Pc_Number" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_CHILD_SEATS" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Number_Of_Cst" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_PORTABLE_PHONES" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_HANDCONTROLS_-_RIGHT" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_HANDCONTROLS_-_LEFT" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_SKIERIZED_VEHICLE" VALUE="">
<INPUT TYPE="HIDDEN" NAME="ZZ_NEVERLOST_NAVIGATIONAL_SYSTEM" VALUE="">
<INPUT TYPE="HIDDEN" NAME="Radio_Buttons" VALUE="All_Rates_Ckd">
<INPUT TYPE="HIDDEN" NAME="Rate_Code" VALUE="913651">
<INPUT TYPE="HIDDEN" NAME="Alt_Radio_Buttons" VALUE="Chk_Rates_Ckd">
<input type="HIDDEN" name="Model_Preference" value="ECAR">
<input type=submit VALUE=">> CONTINUE >>">
</form>


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

Date: Thu, 09 Aug 2001 22:10:04 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Why is $i so popular?
Message-Id: <3b730a3c.1622$54@news.op.net>

In article <oep5ntcvi3fduk1dn895kdv3l60ks7gsjf@4ax.com>,
Lou Moran  <lmoran@wtsg.com> wrote:
>Why is $i such a popular variable?
>
>Is there any significance to it, or is it a foo bar sort of thing?

You see it a lot in East African programs, because 
it is the first letter of the work Swahili word for 'tusk'.

Other than that, no reason.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: 09 Aug 2001 20:38:05 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: XS: ExtUtils/typemap T_IN refcount bug?
Message-Id: <m34rrgda1e.fsf@mumonkan.sunstarsys.com>


I've run into something that looks like a bug in the T_IN, T_OUT, 
and T_INOUT stub code in lib/ExtUtils/typemap, but since I'm not 
sure I figured I'd ask here before reporting.

Here's an (usenet-reformatted) excerpt from the typemap file:

T_IN
        {
            GV *gv = newGVgen("$Package");
            if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) )
                sv_setsv($arg, sv_bless(newRV((SV*)gv), 
                                        gv_stashpv("$Package",1)));
            else
                $arg = &PL_sv_undef;
        }


I don't understand the rationale behind creating a blessed object with
a refcount of "3" ( +1 for newGVgen, +1 for newRV, and +1 for sv_setsv).

It seems like "1" would have been the obvious choice here, which seems 
easily accomplished (similar to what's done in ext/IO/IO.xs):

T_IN
        {
            GV *gv = newGVgen("$Package");

            if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) )
                sv_setsv($arg, sv_bless(newRV_noinc((SV*)gv), 
                                        gv_stashpv("$Package",1)));

            else
                $arg = &PL_sv_undef;

            hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD);
        }


Can anyone explain why ExtUtils/typemap isn't coded like this?
Should I report this to p5p?

TIA.

-- 
Joe Schaefer    "I don't give a damn for a man that can only spell a word one
                                            way."
                                               --Mark Twain



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

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


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