[12150] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5750 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 22 05:07:33 1999

Date: Sat, 22 May 99 02:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 22 May 1999     Volume: 8 Number: 5750

Today's topics:
        $_ doesn't work in map, foreach in nested Safe reval (Joey Hess)
    Re: CGI.pm & popup_menu() (David Efflandt)
        clearing output??? yfmayes@my-dejanews.com
    Re: clearing output??? (Lawrence Rosler)
    Re: clearing output??? <ebohlman@netcom.com>
        Easy Question <mayes+@andrew.cmu.edu>
    Re: Easy Question (Lawrence Rosler)
    Re: Finding Diff of two files <david_jc_evans@msn.kom>
        foreach and print, Please help tvn007@my-dejanews.com
    Re: foreach and print, Please help <ebohlman@netcom.com>
        HELP! Can I edit Perl/cgi scripts using MSDOS prompt? <austin.m@virgin.net>
    Re: HELP! Can I edit Perl/cgi scripts using MSDOS promp <ebohlman@netcom.com>
    Re: how can I make this code more programmatic? <david_jc_evans@msn.kom>
    Re: Need Perl interpreter <ebohlman@netcom.com>
        Newbie Blat help! (Nancy Prince)
        No answer found in Perlfaq <JFedor@datacom-css.com>
    Re: No answer found in Perlfaq (Juho Cederstrom)
    Re: Perl "constructors" armchair@my-dejanews.com
    Re: Perl "constructors" armchair@my-dejanews.com
    Re: Perl "constructors" <rra@stanford.edu>
    Re: Perl "constructors" armchair@my-dejanews.com
        perl for parsing the CBOE options quote pages <stryer@magix.com.sg>
    Re: Perl/Tk and updating Text question <ebohlman@netcom.com>
    Re: Remove line from big flatfile? (Ken Williams)
    Re: Remove line from big flatfile? <ebohlman@netcom.com>
    Re: TROLL ALERT (Re: Perl "constructors") armchair@my-dejanews.com
    Re: Web page redirect - Not working ?perl problem?  Pls <ebohlman@netcom.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 22 May 1999 08:09:25 GMT
From: joey@kite.kitenet.net (Joey Hess)
Subject: $_ doesn't work in map, foreach in nested Safe reval
Message-Id: <slrn7kcphl.fnb.joey@kite.kitenet.net>

Can someone explain to me why $_ is set by map in the first reval, but not
in the nested reval?

Same thing happens if I use foreach with $_ as the implicit loop variable 
(foreach (1..5) { print "got: $_\n" }) but not if I specify $_ as the loop
variable (foreach $_ (1..5) { print "got: $_\n" })

use Safe;
$safe=Safe->new;
$safe->share('$safe');
$safe->permit_only(qw{:default entereval});
$safe->reval(q{
	print join("\n", map { "got: $_" } (1..5))."\n";
	$safe->reval(q{
		print join("\n", map { "got: $_" } (1..5))."\n";
	);
});

I'm using perl 5.004, 5.005_56 has the same problem.

-- 
see shy jo


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

Date: 22 May 1999 08:20:13 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: CGI.pm & popup_menu()
Message-Id: <slrn7kcq2h.jg.efflandt@efflandt.xnet.com>

On Fri, 21 May 1999 19:44:10 -0700, Luis F. Salas <unclelui@grin.net> wrote:
>Hola,
>
>I have written a script that generates a form if no data is supplied,
>and displays the data entered when the form is properly filled in.
>I am using CGI.pm
>
>My question is:
>If I want a selection to be the default, does it have to be the first
>one
>in line? For instance, if I want Information Systems to be the default
>entry, does it have to be at the beginning of the list? I know that 
>works, but is it the only way? What if we want to keep the list in
>alphabetic order? What would be the equivalent of HTML's SELECT (or
>CHECKED) using CGI.pm?

See 'perldoc CGI', or failing that look through CGI.pm itself where the
same docs are included. It is the next item in the list.  Example:

print popup_menu('department',[''Accounting','Administration',
'Human Resources','Information Systems', 'Programming'],
'Information Systems');		# 'Information Systems' selected

(snip)
>Luis
>unclelui@grin.net

-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

Date: Sat, 22 May 1999 04:27:09 GMT
From: yfmayes@my-dejanews.com
Subject: clearing output???
Message-Id: <7i5bmr$uk0$1@nnrp1.deja.com>

Hi,
This is a really dumb question.  However, for
some reason, I can't seem to find an answer in
any indexes.  All I want to do is when is clear
the screen in the script.  It would be just like a
'clear' in unix or 'cls' in dos.
thanks
jm


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


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

Date: Fri, 21 May 1999 22:23:39 -0700
From: lr@hpl.hp.com (Lawrence Rosler)
Subject: Re: clearing output???
Message-Id: <MPG.11afdf3893649466989a44@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <7i5bmr$uk0$1@nnrp1.deja.com>, yfmayes@my-dejanews.com 
says...
> This is a really dumb question.  However, for
> some reason, I can't seem to find an answer in
> any indexes.  All I want to do is when is clear
> the screen in the script.  It would be just like a
> 'clear' in unix or 'cls' in dos.

perlfaq5:  "How do I clear the screen? "

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


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

Date: Sat, 22 May 1999 05:57:26 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: clearing output???
Message-Id: <ebohlmanFC4Dvq.IsB@netcom.com>

yfmayes@my-dejanews.com wrote:
: This is a really dumb question.  However, for
: some reason, I can't seem to find an answer in
: any indexes.  All I want to do is when is clear
: the screen in the script.  It would be just like a
: 'clear' in unix or 'cls' in dos.

See "How do I clear the screen" in perlfaq8.


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

Date: Sat, 22 May 1999 00:33:14 -0400
From: Jonathan J Mayes <mayes+@andrew.cmu.edu>
Subject: Easy Question
Message-Id: <crFXC_q00Ui70AHFw0@andrew.cmu.edu>

Everyone,
    Hi, new to the perl scene, but look forward to questions from this
end.  This time, I'm looking for a function that in perl that will work
like a clear in unix or a cls in dos.  Is there any simple way to do
this, or am I going to have to print out a blank page?  I'm basically
just trying to refresh some on screen data, if that helps.
thanks,
jm 


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

Date: Fri, 21 May 1999 22:25:11 -0700
From: lr@hpl.hp.com (Lawrence Rosler)
Subject: Re: Easy Question
Message-Id: <MPG.11afdf95f401e751989a45@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <crFXC_q00Ui70AHFw0@andrew.cmu.edu>, mayes+@andrew.cmu.edu 
says...
>     Hi, new to the perl scene, but look forward to questions from this
> end.  This time, I'm looking for a function that in perl that will work
> like a clear in unix or a cls in dos.  Is there any simple way to do
> this, or am I going to have to print out a blank page?  I'm basically
> just trying to refresh some on screen data, if that helps.

The Subject when you asked this a few minutes earlier was a lot better 
than this one.

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


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

Date: Sat, 22 May 1999 08:42:57 +0100
From: "Dave Evans" <david_jc_evans@msn.kom>
Subject: Re: Finding Diff of two files
Message-Id: <O$lNYbCp#GA.360@cpmsnbbsa03>

[mailed+posted]

Visit CPAN and download Algorithm::Diff.  Rather useful, I was trying out
this module only the other day.  Comes with the module proper (Diff.pm) and
a couple of .pl scripts to show off its features, including, unsurprisingly,
a "compare two files and show differences" script.

<anilpn@my-dejanews.com> wrote in message
news:7i4j43$eo9$1@nnrp1.deja.com...
> Hi,
>
> I have two files in my vars:
> @file & @file2
>
> How can I find the diff of the two
> files, using perl in a simple way ?
>
> Thanks
> Anil
>
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---




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

Date: Sat, 22 May 1999 07:51:08 GMT
From: tvn007@my-dejanews.com
Subject: foreach and print, Please help
Message-Id: <7i5nld$6nd$1@nnrp1.deja.com>

Hi,

Would someone please help me to make the print statement shorter ?

I have too many conditions that I have to put | $_ eq ..... | $_ eq
in the print statement as you can see below.




foreach (@PIN_NAME) {


   print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
| $_ eq 'I1' | $_ eq 'I2' | $_ eq 'XY' | $_ eq 'AB' | $_ eq 'PX' |
$_ eq 'PT' | $_ eq 'UU' | $_ eq 'OO' ;

}


Thanks in advance,


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


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

Date: Sat, 22 May 1999 08:35:09 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: foreach and print, Please help
Message-Id: <ebohlmanFC4L6L.Cv6@netcom.com>

tvn007@my-dejanews.com wrote:
: Hi,

: Would someone please help me to make the print statement shorter ?

: I have too many conditions that I have to put | $_ eq ..... | $_ eq
: in the print statement as you can see below.

: foreach (@PIN_NAME) {


:    print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
: | $_ eq 'I1' | $_ eq 'I2' | $_ eq 'XY' | $_ eq 'AB' | $_ eq 'PX' |
: $_ eq 'PT' | $_ eq 'UU' | $_ eq 'OO' ;

: }

TMTOWTDI.  Here's two WTDI:

1) Use a regex with alternation:

 print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
   || /^(I1|I2|XY|AB|PX|PT|UU|OO)$/;

See perlre and the section on matching operators in perlop.

2) Use a hash:

  my @unstickable{qw(I1 I2 XY AB PX PT UU OO)} = (1) x 8;
  print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
  || $unstickable{$_};

See perldata, read up on hash slices.




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

Date: Sat, 22 May 1999 08:18:34 +0100
From: "Mark Austin" <austin.m@virgin.net>
Subject: HELP! Can I edit Perl/cgi scripts using MSDOS prompt?
Message-Id: <7i5ljc$3j8$1@nclient3-gui.server.virgin.net>

My developer has let me down and my forum board is getting spammed bad.
There is a subroutine I can add that will allow me to ban IP addresses via a
text file.
My developer was meant to add it but has not and has now disappeared.
Can I do it myself from my PC (I was told the MSDOS prompt editor adds extra
cr/lf characters, but I don't trust the person who told me - it was my
developer!)
Please help
Mark




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

Date: Sat, 22 May 1999 07:24:11 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: HELP! Can I edit Perl/cgi scripts using MSDOS prompt?
Message-Id: <ebohlmanFC4HwB.AIA@netcom.com>

Mark Austin <austin.m@virgin.net> wrote:
: My developer has let me down and my forum board is getting spammed bad.
: There is a subroutine I can add that will allow me to ban IP addresses via a
: text file.
: My developer was meant to add it but has not and has now disappeared.
: Can I do it myself from my PC (I was told the MSDOS prompt editor adds extra
: cr/lf characters, but I don't trust the person who told me - it was my
: developer!)

The DOS editor will work just fine.  It will in fact change the line 
terminators to crlf, but if you make sure to use ascii, rather than 
binary, mode when you FTP your script back to your server, the FTP 
process will translate the line terminators to the correct ones for your 
server.



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

Date: Sat, 22 May 1999 08:48:27 +0100
From: "Dave Evans" <david_jc_evans@msn.kom>
Subject: Re: how can I make this code more programmatic?
Message-Id: <eN32deCp#GA.161@cpmsnbbsa03>

[mailed+posted]

Something like:

@a = &getwords("a.dat");
@b = &getwords("b.dat");
@s = &getwords("a+b.dat");

sub getwords {
    my $file = shift;
    open(IN, $file) or die "open $file: $!";
    <IN>;    # discard first line
    my @ret = split(/\s+/, <IN>);
    close IN;
    @ret;
}

(Sorry, this isn't tested.  But I guess it will work).

tbrannon <brannon@quake.usc.edu> wrote in message
news:ysizhfp6p0sn.fsf@nunki.usc.edu...
> As you can see, the same thing is being done, but I simply need it
> done with A,B, and S. How might I make this task more programmatic and
> less of a cut-and-paste job?
>
> open A, 'a.dat';
> open B, 'b.dat';
> open S, 'a+b.dat';
>
> @A=<A>;
> @a=split '\s+', $A[1];
> @B=<B>;
> @b=split '\s+', $B[1];
> @S=<S>;
> @s=split '\s+', $S[1];
>
>
> --
>    Terrence Brannon  * brannon@lnc.usc.edu * http://lnc.usc.edu/~brannon
> (213) 740-3397 [office] (323) 294-3028 [home]




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

Date: Sat, 22 May 1999 05:23:12 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Need Perl interpreter
Message-Id: <ebohlmanFC4CAp.G2q@netcom.com>

Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
: quikscor@ix.netcom.com (anonymous) writes:

: > Where's the best place to get a Perl interpreter for Windows 98?

: Interpreters'R'Us, just off of Arapahoe and I-25 20 miles
: south of downtown Denver.  It's the little building with
: the giant stuffed camel in front of it.

Note, though, that because of the proximity to Littleton, they won't let 
you in if you're wearing a black camel-hair trenchcoat.  Bummer.



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

Date: Sat, 22 May 1999 06:20:58 GMT
From: nlp@star.org (Nancy Prince)
Subject: Newbie Blat help!
Message-Id: <37464b88.5404948@news.vic.com>

I am trying to use Blat by Greg Elin (2.2.97).  I need to have web
site visitors fill out a form on the web, and I need the results
mailed to me.  Blat is showing a confirmation page, and is sending an
e-mail message; however, I am not able to get the variables from the
user's input on the form into either the confirmation page or the
e-mail.

For instance, one form field is
<input type="text" name="userid">

What do I need to do to get the value of "userid" inserted into the
e-mail message?

Many thanks for any help!

Nancy


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

Date: Sat, 22 May 1999 01:23:55 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: No answer found in Perlfaq
Message-Id: <7i5dda$c8a$1@plonk.apk.net>

I'm trying to read a whole file into a variable.

Such as:

open (FILE,"template.htmt")  || die "Cannot open template file
template.htmt\n";
     while (<FILE>){
              $HTML .=$_;
     }
close(FILE);

 $HTML =~s/\$(\w+)/${$1}/g;
 return $HTML;

I get the whole file into $HTML but I don't know how.  When I used $HTML =$_
I only got
the last line.  What is the significance of the . before the =?

Programming Perl says as an operator . is concatenation but why does it
work?  Can
anyone explain this?

TIA






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

Date: Sat, 22 May 1999 08:36:33 +0300
From: cederstrom@kolumbus.REMOVE_THIS.fi (Juho Cederstrom)
Subject: Re: No answer found in Perlfaq
Message-Id: <slrn7kcgj0.355.cederstrom@vortex.cede.net>

On Sat, 22 May 1999 01:23:55 -0400, 
Jody Fedor <JFedor@datacom-css.com> wrote:
> I get the whole file into $HTML but I don't know how.  When I used $HTML =$_
> I only got
> the last line.  What is the significance of the . before the =?

 tells perl to _add_ the new string in the end of the old string.
Check this:

$a = 'Whatever';
[ $a is now Whatever ]

$a = 'Something';
[ $a is now Something ]

$a .= 'else';
[ $a is now Somethingelse ]

$a = 'Nothing' . $a;		# There are better ways to do this!
[ $a is now NothingSomethingelse ]

$a .= '';
[ $a is now NothingSomethingelse ]

$a = '';
[ $a is now ]


-- 
#!/usr/bin/perl -wT # Please take a look at my mail address when replying
use CGI;$a=reverse"r56%b6%36%16%H02%l27%56%P02%r56%86%47%f6%e6%A02%t37%".
"57%J=japh";$b=new CGI($a);$c=$b->param(lc(reverse("JAPH")));print"$c\n";


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

Date: Sat, 22 May 1999 04:16:16 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7i5b2g$u8n$1@nnrp1.deja.com>

In article <sizp2yculs.fsf@cre.canon.co.uk>,
  Gareth Rees <garethr@cre.canon.co.uk> wrote:
> armchair@my-dejanews.com wrote:
> > int var = function();
> > is var number or a string or an address?
>
> Why limit the set of types you ask about?
>
> Is 'var' an ASCII character?  A Unicode character?
> A year, month or day
> number?  A Unix inode number?  A file descriptor?  Today's temperature
> (in degrees Fahrenheit)?  Yesterday's temperature?  The exponent of a
> new Mersenne prime?  The width of the screen in pixels?  An error code
> (0 is success)?  A status code (0 is failure)?
> A byte-code instruction?
> A 24-bit colour?  An Internet address?
>
> The "type" of data covers all these things and more.  It isn't limited
> to types that a particular compiler knows about, or to a
> set of classes
> that the programmer has defined.  Suppose you have a
> Temperature class:
> you still need to know what the temperature represents, when it was
> taken, how accurate it is, if it's a spot or an average,
> (and if so then
> if it's a mean or a median and if so of how many samples) - and so on.
> All these things are aspects of the data's type.
>
> The C/C++ notion of the type of an object doesn't tell you everything
> you need to know about the object.  Often it tells you very little.
> It's up to the programmer to give meaning to data by documenting
> it and
> by applying correct operations to it.

Your point is well taken, and John Porter is making one similar but
with objects. The fact that it represents temperature should be
reflected in the variable name, and the ranges/units should be given
with a comment in Perl or C++. Can't disagree with that at all. But if
type declaration doesn't tell me everything, does it tell me nothing?

For an example:

int a = object.GetHooziwhatzit();   // C++

my $a = $object->GetHooziwhatzit(); # Perl

The C++ programmer does not know the range of a Hooziwhatzit, nor the
real world phenomenem it is representing, unless given comments/good
variable names,  but they do know at declaration how it is represented
(code reader is not the original programmer).

The Perl programmer (code reader) still wonders -  in addition to what
the C++ programmer ponders above -  is a Hooziwhatzit represented by an
object, string or number? Maybe it doesn't matter, maybe it probably
doesn't matter, maybe the Perl programmer always comments and gives good
variable names that reflect the type, but it certainly doesn't make the
code _easier_ to read.

In Perl I would be tempted to always write

my $a = $object->GetHooziwhatzitNumber(); #or
my $a = $object->GetHooziwhatzitString(); # or
my $a = $object->GetHooziwhatzitObject(); # depending on Hooziwhatzit

if I was writing the methods, or

my $sHoozi = $object->GetHooziwhatzit();
my $nHoozi = $object->GetHooziwhatzit();
my $rHoozi = $object->GetHooziwhatzit();

if I was using the object and it's methods.


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


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

Date: Sat, 22 May 1999 04:28:58 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7i5bq9$ukd$1@nnrp1.deja.com>

In article <yliu9mdb6y.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:
> armchair <armchair@my-dejanews.com> writes:
>
> > my $scalar = myObject->ReturnSomething();
>
> > what does $scalar hold at this moment zenin, number, string or
> > reference?
>
> If you already know what *specifically* that method returns (someone's
> name, tomorrow's date, an open connection to a server),
> then you already
> have more and better information than that and don't need to care.

How do I know how tomorrow's date (GetDateTomorrow() ) is represented -
string, object reference, or number of days since an epoch? I do know,
however that that method is returning me some representation of
tomorrow's date.

>
> If you don't even know what type of
> information myObject->ReturnSomething
> is supposed to return, you have much larger problems and need to
> read the
> documentation of myObject, wherever that may be found.
> Knowing whether
> it's a number, string, or reference won't be enough
> information to write
> code anyway.

That's the point. I have to look into the object _every time_ to find
out what it's method returns. In C++ I can see that it returns a string,
number or OBJECT OF SPECIFIC TYPE - not just (void *) which is what a
Perl reference amounts to. I still may have to look at the object to
determine (or remember what I determined last week) what the method
does, but maybe not. And seeing the type will help me remember what I
already learned about the method.

>
> So in other words, knowing *only* whether something is a
> number, a string,
> or a reference is worthless information by itself.  There's
> therefore no
> reason to force it to be derivable from the semantics of the language.

It's not worthless information to know that an object of type DateTime
is being returned, versus a string that holds a date/time versus an int
that is the seconds since 1/1/1970. And when a type is declared, and it
doesn't match the expected type - compile error in many cases - versus
runtime error or bad results.


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


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

Date: 21 May 1999 22:04:10 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl "constructors"
Message-Id: <yl7lq1ofud.fsf@windlord.stanford.edu>

armchair <armchair@my-dejanews.com> writes:

> How do I know how tomorrow's date (GetDateTomorrow() ) is represented -
> string, object reference, or number of days since an epoch? I do know,
> however that that method is returning me some representation of
> tomorrow's date.

How do you know that in C++?  How do you know what the base of the epoch
is, or what the format of the string is?

> That's the point. I have to look into the object _every time_ to find
> out what it's method returns. In C++ I can see that it returns a string,
> number or OBJECT OF SPECIFIC TYPE

That's nice; it's worthless information.

> And seeing the type will help me remember what I already learned about
> the method.

If seeing the method name doesn't already do that, seeing the return type
isn't going to help you any.

> It's not worthless information to know that an object of type DateTime
> is being returned, versus a string that holds a date/time versus an int
> that is the seconds since 1/1/1970.

That's correct, and a red herring.  C++ doesn't tell you that.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sat, 22 May 1999 05:11:09 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7i5e9d$76$1@nnrp1.deja.com>

In article <7i46he$5cc$1@nnrp1.deja.com>,
  John Porter <jdporter@min.net> wrote:
> In article <7hu1qs$o54$1@nnrp1.deja.com>,
>   armchair@my-dejanews.com wrote:
> > > > Or perhaps I have done something that most Perl programmers
> > > > have not:
> > > > had to modify other people's code.
>
> Perhaps.  Or more likely, you need to get out more, and take
> a look around.
>
> Last project I was on, I had to maintain/enhance a 10,000-line
> system, on which at least five people had worked before me.
> 100% Perl.

I'm not allowed out. But since you are, give me the percentage breakdown
on how Perl is being used (CGI-BIN, database scripts, sysadmin
functions) and what percentage of their time Perl programmers are
maintaing the code of others? And what is a typical size for a Perl
program? How many people are using objects exstensively? inheritance? Is
the stuff on CPAN getting good usage at each site?


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


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

Date: Sat, 22 May 1999 13:20:02 +0800
From: "Stryer" <stryer@magix.com.sg>
Subject: perl for parsing the CBOE options quote pages
Message-Id: <7i5ee2$4ok$1@columbine.singnet.com.sg>

Has anyone written (or know where I can find) a perl
script for parsing the CBOE delayed options quote
pages? (www.cboe.com)

Would be massively grateful for any info.

Thanks
Jeff Stryer




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

Date: Sat, 22 May 1999 05:43:19 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl/Tk and updating Text question
Message-Id: <ebohlmanFC4D87.HpI@netcom.com>

[followups limited to comp.lang.perl.tk]

Marquis de Carvdawg <carvdawg@patriot.net> wrote:
: I'm using AS build 509 on NT workstation 4.0 SP3
: I have a Perl/TK script that has a bunch of widgets...when one
: of the buttons is pressed, a subroutine is called to do some
: work.  Within that subroutine, I have $text->insert() calls that
: are not being completed.  All of the "work" gets done, and the calls
: are made _after_ it's all done...

That's not what's happening.  What's happening is that you're not 
*seeing* the results of the inserts until you hit MainLoop, because 
that's the first place where any of your widgets are actually updated.

Any time you want to visibly change something about a widget, but have to 
wait for some time before you hit (or come back to, if you're making 
changes from a callback) MainLoop, you need to call $mw->update to make 
the changes visible (and to handle any user-generated events).



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

Date: Sat, 22 May 1999 05:06:32 GMT
From: tekkin@hotmail.com (Ken Williams)
Subject: Re: Remove line from big flatfile?
Message-Id: <37463b72.0@news.cgocable.net>

In article <3746296a.0@news.cgocable.net>, tekkin@hotmail.com (Ken Williams) wrote:
>I have a text file that looks like:
>
>name12@here.com:h
>text2@there.com:h
>moretext@isp.com:t
>test@aolsucks.com:h
>testname1@alot.com:t
>
>etc.
>
>Whats the easiest way to remove all, say "moretext@isp.com" lines while 
>keeping everything else the way it is?  Each line a \r\n after it.  So 
>moretext@isp.com:t is actually moretext@isp.com:t\r\n if that matters.

Actually, its not a in a file.  The above data is in a scalar, like $data or 
something.

Does that matter?


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

Date: Sat, 22 May 1999 06:07:15 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Remove line from big flatfile?
Message-Id: <ebohlmanFC4EC3.80y@netcom.com>

Ken Williams <tekkin@hotmail.com> wrote:
: In article <3746296a.0@news.cgocable.net>, tekkin@hotmail.com (Ken Williams) wrote:
: >I have a text file that looks like:
: >
: >name12@here.com:h
: >text2@there.com:h
: >moretext@isp.com:t
: >test@aolsucks.com:h
: >testname1@alot.com:t
: >
: >etc.
: >
: >Whats the easiest way to remove all, say "moretext@isp.com" lines while 
: >keeping everything else the way it is?  Each line a \r\n after it.  So 
: >moretext@isp.com:t is actually moretext@isp.com:t\r\n if that matters.

: Actually, its not a in a file.  The above data is in a scalar, like $data or 
: something.

: Does that matter?

A lot.  If it were in a file, the only way to handle it would be to copy 
all but the lines you wanted to remove to a new file.  But since you've 
got it in a scalar, you have several options.  You can use the s operator 
to simply remove the lines (e.g. $var=~s/^moretext\@isp\.com\r\n//gm;).  
Or you can split the whole string into an array, use grep() to get back 
all the lines you want, and then join them back together; I'll let you 
look this one up yourself:

perldoc -f split
perldoc -f grep
perldoc -f join

There are still several other possibilities.



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

Date: Sat, 22 May 1999 05:22:11 GMT
From: armchair@my-dejanews.com
Subject: Re: TROLL ALERT (Re: Perl "constructors")
Message-Id: <7i5eu2$pj$1@nnrp1.deja.com>

In article <7i4717$5pj$1@nnrp1.deja.com>,
  John Porter <jdporter@min.net> wrote:
> In article <7hmc3t$jrb$1@nnrp1.deja.com>,
>   armchair@my-dejanews.com wrote:
> >
> > If you are saying that the normal way to construct an object
> > is on the
> > heap via:
> >
> > MyClass *pClass = new MyClass();
> >
> > I don't think that I would agree with that.
>
> Maybe I'm just being dense, but what other way is there to
> construct an
> object on the heap?

It is "on the heap" versus "on the stack", not "this way of heap
construction".

>
> > C++, as I mentioned before, actually
> > gives you more ways to make a class than Perl does.
>
> Well, making a class and making an instance of a class are two
> entirely separate things, of course.  I think we were talking about
> the latter...  Can you show an example that illustrates your point?
> What are these different ways of constructing an object that C++
> gives you?

The statement was regarding what you can store in an object at "the
highest level". (as in the this/perl-reference can point to 1..n things
in C++, but only one thing in Perl).  Russ Allberry  and I were not
discussing instantiation of objects, rather coding of classes.


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


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

Date: Sat, 22 May 1999 05:38:49 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Web page redirect - Not working ?perl problem?  Plse help!
Message-Id: <ebohlmanFC4D0p.HED@netcom.com>

Kira S. Anastasia <kirasa@oz.net> wrote:
: Hi Jane and thanks!

: > print "Content-type: text/html\n\n";
: > 
: > make this the second line in your script.

: Did so:
: [ ... ]
: print "Location: $url\n\n";

That double newline indicates that you're done sending out headers.

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

And therefore this line isn't interpreted as a header.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 V8 Issue 5750
**************************************

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