[12569] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6169 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 18:07:49 1999

Date: Tue, 29 Jun 99 15:00:22 -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           Tue, 29 Jun 1999     Volume: 8 Number: 6169

Today's topics:
    Re: Associative array of a two dimensional array (Andrew Allen)
        chomp previous line? <John.Little@Duke/dot/.edu>
        Extracting specific text from specific files in a list <leejk@cat.com>
    Re: Help with an array test (Andrew Allen)
    Re: MKTEMP <swiftkid@bigfoot.com>
    Re: MKTEMP <rootbeer@redcat.com>
    Re: My First Perl error...I'm just learning. <rootbeer@redcat.com>
    Re: My First Perl error...I'm just learning. <swiftkid@bigfoot.com>
    Re: My First Perl error...I'm just learning. (John Boswick)
    Re: My First Perl error...I'm just learning. <upsetter@ziplink.net>
    Re: My First Perl error...I'm just learning. <binder@publique.at>
        need help with GetGroups() <gio98dr@yahoo.com>
    Re: need help with GetGroups() <knetter@americasm10.nt.com>
    Re: Newbie?: Is FreeBSD OK with Perl & Apache? <rootbeer@redcat.com>
    Re: output the hexadecimal value of character from a st (Greg Bacon)
    Re: Pattern matching $1-$n not being pulled <peter_jones@my-deja.com>
    Re: regexp riddle <hiller@email.com>
    Re: regexp riddle (Greg Bacon)
    Re: regexp riddle <jcreed@cyclone.jprc.com>
    Re: regexp text wrapping question <rootbeer@redcat.com>
    Re: regular expresion HELP!!! (Greg Bacon)
    Re: regular expresion HELP!!! <rootbeer@redcat.com>
    Re: Robot email/poster for this group (Marcel Grunauer)
    Re: Robot email/poster for this group (Marcel Grunauer)
    Re: Robot email/poster for this group <cassell@mail.cor.epa.gov>
    Re: sybperl help <mpeppler@peppler.org>
    Re: upload script <jw77@lucent.com>
    Re: upload script <rootbeer@redcat.com>
    Re: Using WindowsNT and ActivePerl and Job Scheduling ( <martin@klg.com>
    Re: Using WindowsNT and ActivePerl and Job Scheduling ( <carvdawg@patriot.net>
    Re: Week Number without Date Module? (Dave Cross)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 29 Jun 1999 21:43:06 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Associative array of a two dimensional array
Message-Id: <7lbela$rdu$2@fcnews.fc.hp.com>

Peter Jones (peter_jones@my-deja.com) wrote:

: also, instead of using splice @ln, 0; you can say @ln = () or @ln =
: undef;

small correction:

'@ln=undef' will set @ln to a one-element list containing undef. You
probably meant 'undef @ln';

Although I kind of like 'splice @ln,0'. It's so... idiomatic.

Andrew


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

Date: Tue, 29 Jun 1999 17:35:23 -0400
From: "John Little" <John.Little@Duke/dot/.edu>
Subject: chomp previous line?
Message-Id: <7lbe74$rk5$1@news.duke.edu>

Can some help me understand how to chomp the previous line.  The only way I
can identify the lines that are a problem is by identifying all lines which
begin without a quotation mark.  In those case the previous line should be
chomped. Of coure by the time I identify the line which doesn't begin with a
quotation mark I've already passed the line I need to work on.

Any help is greatly appreciated.

--John

--






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

Date: Tue, 29 Jun 1999 17:20:21 -0400
From: "Keith Lee" <leejk@cat.com>
Subject: Extracting specific text from specific files in a list
Message-Id: <7lbdab$qdu$1@ns1.cat.com>

Hello,
    I posted a question similiar to this today, about how to copy the
contents of specific files that a user specified as input into one new file.
A gentlemen was kind to enough to show me were my code was failing, and gave
me a solution. Now, I have found that I must further restrict what is copied
from the original files to the new file. When I open the file, I need to
start reading it's contents at a specific string of text, and which I would
need to append the $file variable to the string as part of the match. Just
counting lines from the top won't cut it. Here is part of how I am opening
the files:

if (-f "$txt_dir/$file" && open(FOO, "$txt_dir/$file")) {
### I need some kind of pattern matching here to start reading at a
### certain place in the file
        print FILE <FOO>; #new file's filehandle
        close(FOO);
    }

For example: myfile is the name of the current file I am opening, so $file
now has the value "myfile". After I open the file but before I write it's
contents out to newfile, I want to start reading at the string "name=" and
append $file to the pattern, so it would start reading at "name=myfile" in
the file, and skip information before that. I have been reading about
pattern matching, but haven't run across any examples similiar to what I
want to do. Anyone have an idea?

Thanks,
Keith




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

Date: 29 Jun 1999 21:37:02 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Help with an array test
Message-Id: <7lbe9u$rdu$1@fcnews.fc.hp.com>

Marcel Grunauer (marcel.grunauer@lovely.net) wrote:
: On Tue, 29 Jun 1999 12:38:15 -0600, Jeff Beard
: <jeffbREMOVETHIS@mcguckin.com> wrote:

: >I need to test an array to see if all values are null. If they are, do
: >one things if not, do another. I've been playing with loops that test if
: >each element is null but I need to know if they're all null.

: Not exactly sure whether this is what you mean, but I took it to mean
: "all elements should be 0", not "undef". Anyway, here it goes:

: @test = (0, 0, 0, 0);

: if (join('',@test) eq '0'x@test) {
: 	# all elements are 0
: }

Umm, what if @test=("00","",0,0) ? Why wouldn't you do something
straightforward like:

  unless(grep($_ ne "0",@test)) { 
    # all elements are 0
  }

Andrew


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

Date: Wed, 30 Jun 1999 01:24:54 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: MKTEMP
Message-Id: <7lcdbc$5if6@news.cyber.net.pk>

<snip>

> Even when your script is "just an example" (and perhaps especially in that
> case!) you should _always_ check the return value after opening a file.
>
> On many systems, this will produce a filename collision around one time in
> 32768 (not one time in 10000, but still bad).
>
> Cheers!

How about:

$tmpfile = time . $$;

long, but unique?

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift  ICQ: 4265451
FAX: (815) 846-2877





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

Date: Tue, 29 Jun 1999 14:51:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: MKTEMP
Message-Id: <Pine.GSO.4.02A.9906291447320.4425-100000@user2.teleport.com>

On Wed, 30 Jun 1999, Faisal Nasim wrote:

> How about:
> 
> $tmpfile = time . $$;
> 
> long, but unique?

Ah, it should be unique. But you may be creating a file on a filesystem
shared with another machine, so beware!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 29 Jun 1999 14:06:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <Pine.GSO.4.02A.9906291405330.4425-100000@user2.teleport.com>

On Tue, 29 Jun 1999 av8tor@flash.net wrote:

> Simple..  I've also contacted my webhost company and they told me the
> location of perl is  /bin/perl and they told me I was setup to use CGI.
> Other than that they are NO help

They're not worth whatever you're paying them, then.

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 30 Jun 1999 01:22:15 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <7lcd6b$57d10@news.cyber.net.pk>

<av8tor@flash.net> wrote in message news:7lb6l7$p66$1@nnrp1.deja.com...
> I'm just starting to learn perl and CGI.
> I'm getting the following error when trying to call my program from
> Netscape:

<snip>

Make sure you are uploading as ascii and also you put the file
in cgi-bin (filename is case sensitive)


you have to print the content-type header too!

#!/bin/perl

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

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift  ICQ: 4265451
FAX: (815) 846-2877





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

Date: Tue, 29 Jun 1999 20:36:16 GMT
From: John.Borwick@sas.com (John Boswick)
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <377a2d6c.116102766@newshost.unx.sas.com>

On Tue, 29 Jun 1999 19:26:47 GMT, av8tor@flash.net wrote:

 ...
>Other than that they are NO help (www.icom.com)  I've changed the file
>permissions so all three groups have excute privilages.
 ...

does the web server have read permissions as well?  it can't interpret
your script otherwise.

john borwick


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

Date: Tue, 29 Jun 1999 21:31:49 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <9Xae3.265$6M6.94547@news.shore.net>

Faisal Nasim <swiftkid@bigfoot.com> wrote:
: you have to print the content-type header too!

: #!/bin/perl

: print "Content-type: text/html\n\nIt works!";
                            ^^^^

Wouldn't you think that "plain" would be more appropriate in this case?

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Tue, 29 Jun 1999 23:49:17 +0200
From: Tom Binder <binder@publique.at>
Subject: Re: My First Perl error...I'm just learning.
Message-Id: <37793F57.5AC00D9E@publique.at>

well, depending on the servers os you might have to have your skript set
executable. when you want to output something via the web server from a
perl skript, you must send a http header to tell the server what type of
data it is sending to the browser. i. e. try:


    #!/bin/perl

    print "Content-type: text/html\n\n"; #2 newlines required!

    print "it works!\n";

depending on the server, you also should consider printing out the <html>
start tag.

av8tor@flash.net schrieb:

> I'm just starting to learn perl and CGI.
> I'm getting the following error when trying to call my program from
> Netscape:
> ...cut...



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

Date: Tue, 29 Jun 1999 21:08:38 GMT
From: "Giovanni Davila" <gio98dr@yahoo.com>
Subject: need help with GetGroups()
Message-Id: <qBae3.860$w4.9165@news1.frmt1.sfba.home.com>

I'm having a problem running the script below.
GetGroups does not seem to like my $g variable. Any ideas??
Please help.

use Win32::AdminMisc;
print "Enter Domain name to get list of groups from: ";
chomp ($machine = <STDIN>);
g_DumpGroups ($machine);
print "bye\n";

# it dumps all groups in a particular machine
sub g_DumpGroups
{
 @grupos = ('GROUP_TYPE_LOCAL', 'GROUP_TYPE_GLOBAL', 'GROUP_TYPE_ALL');
 print "\n$machine\n";
 $cuenta = 0;  # counts groups retrieved
 $c_grupo = 0;  # counts group type
 while ($c_grupo < 3)
 {
  $g = @grupos[$c_grupo];
  print "These are the $g\n";
  if (Win32::AdminMisc::GetGroups($machine, '$g', \@LGroups))
  {
     map
   {
        printf ("\%03d) %s\n", ++$cuenta, $_);
       }
     @LGroups;
   }
  else
  {
   print "\n*Problem!  Could not find groups in $machine\n";
  }
  $c_grupo++;
 }
}




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

Date: Tue, 29 Jun 1999 16:47:05 -0500
From: "Netterville, Scott [RICH6:2G52:EXCH]" <knetter@americasm10.nt.com>
Subject: Re: need help with GetGroups()
Message-Id: <37793ED9.34ACC665@americasm10.nt.com>

Giovanni Davila wrote:

> I'm having a problem running the script below.
> GetGroups does not seem to like my $g variable. Any ideas??
> Please help.
>

<snip>


>
>  while ($c_grupo < 3)
>  {
>   $g = @grupos[$c_grupo]; ##<-- change to $g=$grupos[$c_grupo];
>   print "These are the $g\n";
>   if (Win32::AdminMisc::GetGroups($machine, '$g', \@LGroups))
>   {
>      map
>

<snip>

Just at a glance, one obvious error is that you are using
@grupos[$c_grupo] where
you probably meant $grupos[$c_grupo].

Scott




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

Date: Tue, 29 Jun 1999 14:44:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie?: Is FreeBSD OK with Perl & Apache?
Message-Id: <Pine.GSO.4.02A.9906291443470.4425-100000@user2.teleport.com>

On Tue, 29 Jun 1999, will wrote:

> My question is there an advantage for loading Linux5.2 in favor of
> FreeBSD that I already have? 

There might be. Do you already know how to find the newsgroups about Linux
to ask about this?

> This is not flame war troll but I want to find out which OS would be
> best for PERL & apache. 

I don't know about Apache, but if your OS is good for you, it's probably
good for Perl as well. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 29 Jun 1999 21:22:12 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: output the hexadecimal value of character from a string
Message-Id: <7lbde4$mvs$3@info2.uah.edu>

In article <slrn7ng3gt.l3m.drbrain@josefine.ben.tuwien.ac.at>,
	drbrain@ziemlich.org (markus) writes:
: 	This one catched me latly, when i just tried to print for every
: character in a string its hexadeizmal value. So e.g. the string is "ABC" it
: would print "0x29 0x30 0x31".

What character set are you using?

: I found the function 'hex' which converts _from_
: hex _to_ decimal. There isn't mentioned any counterpart function.

If only you'd searched for hex just a few more times in the perlfunc
manpage.

    #! /usr/bin/perl -w

    use strict;

    while (<>) {
        chomp;

        print join(" ", map { sprintf "0x%02X", ord } split //), "\n";
    }

Enjoy,
Greg
-- 
Democracy: Two wolves and a sheep voting on what's for dinner.


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

Date: Tue, 29 Jun 1999 20:55:10 GMT
From: Peter Jones <peter_jones@my-deja.com>
Subject: Re: Pattern matching $1-$n not being pulled
Message-Id: <7lbbr8$r97$1@nnrp1.deja.com>

In article <7lb40k$o2h$1@nnrp1.deja.com>,
  e_broyles2@my-deja.com wrote:
> Can someone tell me why when I do this:
>
> $myvar = "134:00:34:56";
>
> if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
>      print "$1\n";
>      print "$2\n";
>      print "$3\n";
>      print "$4\n";
> }
>
> I get the following output:
>
> 134
> 00
> 34
>
> Instead of
>
> 134
> 00
> 34
> 56
>
> Thanks!
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

because you are using minimal matching (*?). The pattern will stop as
soon as it can (match as little as possible). Your regex says that it
can stop matching after the final ':' so it will not match the last
group of numbers. there are a few things you can do, here are some
example reqexs...

/^(\d+):(\d+):(\d+):(\d)$/

which will match numbers with ':' as a seperator.

/^([^:]+):([^:]+):([^:]+):([^:]+)$/
which will match all chars that are not ':' with ':' as a seperator.

you can also do this...
@parts = split(/:/, $myvar);
which will fill @parts with everything that is not ':' so you get
$parts[0] = '134';
$parts[1] = '00';
$parts[2] = '34';
$parts[3] = '56';


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


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

Date: Tue, 29 Jun 1999 21:10:17 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: regexp riddle
Message-Id: <377935BC.D1FE1515@email.com>

"Soulier, Michael [SKY:1Z22:EXCH]" wrote:
> 
>         [dxbe]{1,4}
> 
>         Simple. However, I need to add one more condition. The
> characters are
> not permitted to repeat.

If it's possible to use backreferences this way, maybe you can attempt something
like this. This would exclude things that already have been matched but I know
my code is quite right. Maybe someone can try fixing it up.

([dxbe])([dxbe^\1])([dxbe^\1\2])([dxbe^\1\2\3])

HTH,
Jordan


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

Date: 29 Jun 1999 21:11:27 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: regexp riddle
Message-Id: <7lbcpv$mvs$1@info2.uah.edu>

In article <37792B90.ED90B57D@americasm01.nt.com>,
	"Soulier, Michael [SKY:1Z22:EXCH]" <msoulier@americasm01.nt.com> writes:
: I need to match a string consisting of the characters d, x, b and e,
: in any order, and any length from 1 to 4 characters long. The regexp for
: my : specifications so far is
: 
:         [dxbe]{1,4}   
: 
: Simple. However, I need to add one more condition. The characters are
: not permitted to repeat. 

    #! /usr/bin/perl -w

    use strict;

    sub permute {
        my @a = @_;
        my @result;
        my $elt;

        return \@a if @a == 1;

        for (1 .. scalar @a) {
            $elt = shift @a;
            push @result, map { [ $elt, @$_ ] } permute(@a);
            push @a, $elt;
        }

        @result;
    }

    my @p = permute qw( d x b e );
    my $re = join '|', map { join '', @$_ } @p;

    while (<>) {
        chomp;
        
        if (/^${re}$/o) {
            print "`$_' is a match!\n";
        }
    }

Enjoy,
Greg
-- 
I guess I just prefer to see the dark side of things. The glass is always
half-empty. And cracked. And I just cut my lip on it. And chipped a tooth. 
    -- Janeane Garofalo


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

Date: 29 Jun 1999 17:35:03 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: regexp riddle
Message-Id: <a16746g06w.fsf@cyclone.jprc.com>

"Soulier, Michael [SKY:1Z22:EXCH]" <msoulier@americasm01.nt.com> writes:


>         I need to match a string consisting of the characters d, x, b
> and e, in any order, and any length from 1 to 4 characters long. 
> [...] However, I need to add one more condition. The
> characters are not permitted to repeat. 
> [...]
> 	Please note, a single regexp is my desired option here. [...]
> additional code can accomplish this, but I want to use a single regexp
> for design reasons. 

$str=~('^('.(join"|",map{$_->($_->($_->($_->(""))))}sub{keys %{{map{
$_,1}grep{!/(.).*\1/}map{split/,/,"d$_,x$_,b$_,e$_,$_"}@_}}}).')$');

(Hoping nobody takes that seriously)

---Jason


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

Date: Tue, 29 Jun 1999 13:59:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: regexp text wrapping question
Message-Id: <Pine.GSO.4.02A.9906291339510.4425-100000@user2.teleport.com>

On Tue, 29 Jun 1999, Martin wrote:

> I've been trying to split $foo into elements of @foo with each element
> being upto 53 characters long but I want $foo to be split at word
> boundaries only (unless there is a word with more than 53 characters).

Maybe this?

    @foo = $foo =~ /(.{1,53}\b|.{54,}?\b)/sg;

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 29 Jun 1999 21:13:31 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: regular expresion HELP!!!
Message-Id: <7lbctr$mvs$2@info2.uah.edu>

In article <7lbabr$qlj$1@nnrp1.deja.com>,
	evargas@my-deja.com writes:
: I'm trying to capture all the subject lines of an
: email using regular expression but I'm only able
: to  catch the first lines. All email systems brake
: the subject line when it is to long.

Please read Section Nine of the fine Perl FAQ, paying close attention
when you reach "How do I parse a mail header?".

Greg
-- 
In an intellectually equal society, who will be the busboys? 
    -- Lenny Bruce


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

Date: Tue, 29 Jun 1999 14:37:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: regular expresion HELP!!!
Message-Id: <Pine.GSO.4.02A.9906291436590.4425-100000@user2.teleport.com>

On Tue, 29 Jun 1999 evargas@my-deja.com wrote:

> I'm trying to capture all the subject lines of an email

Why aren't you using a module from CPAN which will do this for you simply
and easily?

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 29 Jun 1999 20:22:02 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Robot email/poster for this group
Message-Id: <377c2aaf.7330570@enews.newsguy.com>

On 29 Jun 1999 19:21:41 GMT, stanley@skyking.OCE.ORST.EDU (John
Stanley) wrote:

[Addendum] to my earlier post:

Sorry for being to hasty - I just saw that you *did* post to moderated
as well. However, my criticiscms for spreading FUD stand.

Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: Tue, 29 Jun 1999 20:18:17 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Robot email/poster for this group
Message-Id: <377b27a4.6551971@enews.newsguy.com>

On 29 Jun 1999 19:21:41 GMT, stanley@skyking.OCE.ORST.EDU (John
Stanley) wrote:

>I lost count of the number of people who complained that this newsgroup
>was becoming a "help desk", and who voted for a moderated group so they
>could get away from the problem. Now they want to turn this group into a
>help desk ("Miscy -- help me...") after they have created a different
>group for themselves. They wanted to leave, and now they want to program
>the solution for us after they are gone.

Why didn't you post this to the relevant thread on
comp.lang.perl.moderated? Afraid you might have to join in the
discussion?

No, just post it here, where you can spread FUD. "They want to leave!
It's the end of Perl as we know it! They're moving to another
dimension and leave us to deal with the Shadows!"
"They will cast the level 9 Miscy spell on this group and turn it into
a squeaking helpdesk!"

Please.

The moderated group doesn't really get much traffic, and by far the
bulk of the discussion takes place here. But a lot of the questions
that get posted here (note the wording, does it sound a bit like a
helpdesk?) *are* FAQs, and I can understand that people are getting
tired of posting the same answers again and again. And again.

Some frequent posters must begin to feel like an organic version of
Miscy already, so think of Miscy as a patient frequent poster who will
never get tired of answering questions like "How can I use a variable
name as a variable" or "Linux better than Perl?" or "Testing, please
ignore".

But social issues aside you'll have to admit that it is a fascinating
project.


Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: Tue, 29 Jun 1999 14:24:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Robot email/poster for this group
Message-Id: <3779397D.84D133B7@mail.cor.epa.gov>

John Stanley wrote:
> 
> If you do not read comp.lang.perl.moderated, you might not have learned
> that the gurus there are contemplating the creation of a robot for this
> group. I haven't seen them discuss it here, though.
> you.

Oh, they will.  Someone will.  Just wait and see...
 
> Not like the robot that sends the FAQ to each new poster, the proposed
> robot would read your articles and try to figure out what question you
> were asking. Then it would mail you the "correct" FAQ, and possibly
> post a message to the newsgroup saying it had mailed you the FAQ.

Not necessarily.  It may not be anything like this.  What you
have is one scenario by one poster.  Others were insistent
that there not be email running around loose.  The final form
is still *totally* up in the air.
 
> So, if you come to the group after reading the FAQ and have a question,
> you may very well get a nice email telling you to read the FAQ, and a
> posting here that says that the answer is in the FAQ you were mailed. If

You mean, as opposed to the automatic "Go read the FAQ, you stupid
clueless pinhead" posts we now see?  My guess is that we're more likely
to see a newsgroup auto-reply with the [hopefully] relevant info in
it.  But right now, no one knows.  It was only put forth as a
suggestion a matter of hours ago, after all.

> you don't ask it in terms that the robot has programmed into it, you may
> get a FAQ that is irrelevant to the question. If you are simply
> expressing an opinion, you may get mailed a FAQ with the answer to your
> opinion.

My personal suspicion is that if the autobot can't differentiate
well enough to avoid these events most of the time, it will be
scrapped as useless.  No one wants *more* bandwidth waste here.
Well, other than my posts.  :-)
 
> There have even been proposed a way to post questions to the robot,
> which has been given the cute name "miscy". "Miscy -- what is the URL
> for X?"

And most people thought this was a bad idea, if I remember the
counts correctly.  I think this one is unlikely for the newsgroup,
although a possibility for an accessible website.  I agree with you
that this could be another good bandwidth-waster.

> I think this is a fine idea -- for a special group devoted to robot
> operation. It is great for a mail agent. For a discussion group, this
> is a bad idea. Discussion groups do not need a robot jumping in with
> email and postings. Test newsgroups where robots respond to each
> article are one thing. Comp.lang.perl.misc is not a test newsgroup.
> This newsgroup is noisy enough with the distribution of FAQs and man
> pages on a regular basis, it does not need more noise from a robot.

Have you checked out #perl?  Ask url for some help to a question.
Ask the people there what their opinions are on url's helpfulness.
If an autobot can work in a Perl IRC setting, I don't see why it
wouldn't work here.

And if it didn't work well, who amongst the gurus would want it
to ever see the light of day?  Hubris [the programmer virtue and the
Greek noun] wouldn't permit them to let a bad program loose in public.
 
> I lost count of the number of people who complained that this newsgroup
> was becoming a "help desk", and who voted for a moderated group so they
> could get away from the problem.

The gurus who didn't want to associate with the great unwashed have
left this newsgroup never to return.  They have other newsgroups and
listservs where they live.  What does that have to do with the
conscientious people who continue to answer questions here,
regardless of their level of frustration?

>                                  Now they want to turn this group into a
> help desk ("Miscy -- help me...") after they have created a different
> group for themselves. They wanted to leave, and now they want to program
> the solution for us after they are gone.

Hardly.  I think that is really unfair to the people who talked about 
this in c.l.perl.moderated .  They wanted to find a *better* way
to answer some of the questions that hit here with great regularity.

Don't you think it would be better for everyone if Miscy answered
someone who asked about CGI redirections with a polite [if canned]
response, rather than having [the names are changed to protect the
guilty] PedantBoy flame the poster, then Grouchy yell at the poster
for posting in the wrong group, then InYrFace tell them to go RTFFAQ,
then DropDead tell them to give up programming and go flip burgers
for a living, then...  Well, you get my drift.

My feeling is that I'm more than willing to see how this experiment
turns out.  If it's good for the new posters, then it's good.
If it fails for the new posters, then it's bad.  If it doesn't do
a good job, and it doesn't manage to remain unintrusive, I'll
lobby to get rid of it.  How?  That's easy.  I'll threaten to
tell the Python and Java groups about how bad it is, unless it is
fixed or removed.  :-)

If you're really that concerned about Miscy turning into some sort
of Perlish version of the Forbin Project, then you could volunteer
in the project and make your voice heard.. not to mention your
programming skills.  This is not a Gurus-vs-Newbies issue.  This
is a helping-others issue.

And it might even help us get TomC's blood pressure back down
below 190/140 .  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 29 Jun 1999 14:17:37 -0700
From: Michael Peppler <mpeppler@peppler.org>
Subject: Re: sybperl help
Message-Id: <377937F1.86C4EFAB@peppler.org>

jessica.qing.wang@bankerstrust.com wrote:
> 
> hi all,
> I am new to Sybperl. And this is my first program.
> 

<code snipped>

> 
> But I got compiling error as following:
> Global symbol "$dbh" requires explicit package name at test.pl line13.
> Global symbol $dbh_dbclose" requires explicit package name at test.pl
> line 29. (test.pl is the file name).

Either add $dbh to the 
	use vars qw() 
line, or do
	my $dbh = new Sybase::DBlib ...

You probably mean 
	$dbh->dbclose;
instead of 
	$dbh_dbclose;

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com


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

Date: Tue, 29 Jun 1999 17:08:18 -0400
From: Joe Warakomski <jw77@lucent.com>
Subject: Re: upload script
Message-Id: <377935C2.EC46D6AB@lucent.com>

Here are three sections of the CI and HTML

<----------------HTML: POST FILE & DESCRIPTION------------------------>
<FORM ENCTYPE="multipart/form-data" ACTION="cgi-bin/file-upload.cgi"
METHOD="POST">
        <TABLE BORDER=0 WIDTH="460">
        <TR>
            <TD ALIGN=RIGHT>
                File 1:
            </TD>
            <TD>
                <INPUT TYPE="FILE" NAME="file-to-upload-01" SIZE="35">
                <INPUT TYPE="TEXT" NAME="file-description-01" >
            </TD>
        <TR>
            <TD>
                <INPUT TYPE="SUBMIT" VALUE="Upload File(s)!">
            </TD>
            <TD ALIGN=RIGHT>
                <INPUT TYPE="RESET" VALUE="Reset Form">

<!-------------------CGI: READ IN FROM HTML------------------->
<>I am not sure if the error is in here or the next section


foreach $key (sort {$a <=> $b} $query->param()) {
                next if ($key =~ /^\s*$/);
                next if ($query->param($key) =~ /^\s*$/);
                next if ($key !~ /^file-to-upload-(\d+)$/);
                $Number = $1;

                if ($query->param($key) =~ /([^\/\\]+)$/) {
                        $Filename = $1;
                        $Filename =~ s/^\.+//;
                        $File_Handle = $query->param($key);

<!--------------------CGI: OUTPUT BACK TO HTML----------------->

 print header;
                print <<__END_OF_HTML_CODE__;

                <HTML>
                <HEAD>
                        <TITLE>Upload Finished</TITLE>
                </HEAD>
                <BODY BGCOLOR="#FFFFFF">
                <H1>Upload Finished</H1>
                <P><br><br>The file name is <b>$Filename</b> <br>
Description: <b>
               $in{'file-description-01'}</b><br>Uploaded on:
<b>$date</b> | <b>$time</b><br><br><br>

                You uploaded <B>$FILES_UPLOADED</B> files totalling
<B>$TOTAL_BYTES</B> total bytes.  Individual
                file information is listed below:
                <PRE>

__END_OF_HTML_CODE__

                foreach $key (keys (%Confirmation)) {
                        print "$key - $Confirmation{$key} bytes\n";
                }

                print <<__END_OF_HTML_CODE__;




<----------------------------------------------------------->

Tom Phoenix wrote:
> 
> On Tue, 29 Jun 1999, Joe Warakomski wrote:
> 
> > I am currently using this script
> > (http://www.terminalp.com/scripts/file_upload.shtml) for uploading via
> > the web.  The script runs great, although I added another field for a
> > description of the file.  When script runs and displays the output it
> > does not display the description, although all other field names are
> > displayed.  I doubled checked all variable names between the HTML and
> > CGI and everything matches.  If anyone could help, it would be
> > appreciated.
> 
> There's a bug in your program. I'm not sure what other help you are
> expecting, though, since you didn't include any code. Wait! Don't post
> your whole program. Cut it down to the smallest example which shows the
> behavior you're seeing. By posting something with no more than a dozen
> lines, you'll have a good chance that someone will spot the error. Maybe
> it'll even be you!
> 
> Good luck with it!
> 
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Tue, 29 Jun 1999 14:56:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: upload script
Message-Id: <Pine.GSO.4.02A.9906291455360.4425-100000@user2.teleport.com>

On Tue, 29 Jun 1999, Joe Warakomski wrote:

>                $in{'file-description-01'}</b><br>Uploaded on:

Did you ever put anything into %in? Using 'use strict' and -w warnings can
be useful. Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 29 Jun 1999 17:34:24 -0400
From: Martin Little <martin@klg.com>
Subject: Re: Using WindowsNT and ActivePerl and Job Scheduling (at command)
Message-Id: <37793BE0.56AF05B2@klg.com>

AT runs as a slightly different user, with slightly
different permissions.   Some things work, some
things don't.

You can change the user the AT scheduler runs as,
but this just seems to open a whole other can of
worms.

I myself just use cron on a unix box and execute
the scripts remotely.

 ../Martin

Joe Devine wrote:

> I've managed to get my PERL scripts running with the
> Windows NT AT command by putting them in a batch
> batch file before I call PERL.
>
> However, PERL seems to have some problems reading
> the remotely mapped (network) drive that I'm trying to
> list when running under AT.
>
> When I run the PERL program from the command line
> (DOS) it works just fine. But the readdir() function in
> my script returns nothing when it runs under AT.
>
> So my questions are thus:
>
> 1. Has anyone tried to do this and if so, how?
> 2. Is there anything obvious that I might be doing wrong?
> 3. Are there any PERL modules that might help with
>    reading remotely mapped drives?
>
> Thanks in advance!!!
>
> jdevine@thegift.com



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

Date: Tue, 29 Jun 1999 17:43:46 +0100
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Using WindowsNT and ActivePerl and Job Scheduling (at command)
Message-Id: <3778F7C2.472AC8E4@patriot.net>

> 1. Has anyone tried to do this and if so, how?

See Tom's response concerning your environment variables.

> 2. Is there anything obvious that I might be doing wrong?
> 3. Are there any PERL modules that might help with
>    reading remotely mapped drives?

Win32::Lanman works really well for this...



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

Date: Tue, 29 Jun 1999 21:30:30 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Week Number without Date Module?
Message-Id: <37793ac3.52075081@news.demon.co.uk>

On Tue, 29 Jun 1999 13:55:47 GMT, Gareth Rees
<garethr@cre.canon.co.uk> wrote:

>Dave Cross <dave@dave.org.uk> wrote:
>> Of course, it all depends on what your definition of a week number is,
>
>Use the standard!  (That is, ISO 8601 "Data elements and interchange
>formats - Information exchange - Representation of dates and times"
>http://www.iso.ch/markete/8601.pdf)
>
>    3.17 week, calendar: A seven day period [...] starting on a Monday
>    and identified by its ordinal number within the year; the first
>    calendar week of the year is the one that includes the first
>    Thursday of that year.  In the Gregorian calendar, this is
>    equivalent to the week which includes 4 January.

That's fine if your organisation uses the ISO standard. From what I've
seen, in practice many don't.

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

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

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