[22640] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4861 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 18 14:07:40 2003

Date: Fri, 18 Apr 2003 11:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 18 Apr 2003     Volume: 10 Number: 4861

Today's topics:
        ANN: International Perl Beginners Mailing List <shlomif@vipe.technion.ac.il>
    Re: ANN: International Perl Beginners Mailing List (Randal L. Schwartz)
    Re: ANN: International Perl Beginners Mailing List <shlomif@vipe.technion.ac.il>
    Re: ANN: International Perl Beginners Mailing List <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
    Re: ANN: International Perl Beginners Mailing List <flavell@mail.cern.ch>
    Re: ANN: International Perl Beginners Mailing List <abigail@abigail.nl>
    Re: Can I die and also write to a log file? <bobx@linuxmail.org>
        English --> Orkish text filter (Arduin)
    Re: Good Programming Practices - Avoiding Memory Leaks <kevin.vaughn@ttu.edu>
    Re: Good Programming Practices - Avoiding Memory Leaks <abigail@abigail.nl>
    Re: GUI Development Options (Bryan Castillo)
    Re: Help with script to parse a log file and run a comm (MichaelS)
    Re: Help with script to parse a log file and run a comm (MichaelS)
    Re: Help with script to parse a log file and run a comm <abigail@abigail.nl>
        Metadot Portal Server v5.5.2.1 (GPL) (Daniel Guermeur)
        my cgi works but won't execute external commands such a <jollyjoejimbob@hotmail.com>
    Re: Need advice on my first Perl script (Scott Spencer)
    Re: newbie lib dir question <eddy@NOSPAMaxa.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 18 Apr 2003 11:20:18 +0300
From: Shlomi Fish <shlomif@vipe.technion.ac.il>
To: Israeli Perl Mongers <perl@perl.org.il>
Subject: ANN: International Perl Beginners Mailing List
Message-Id: <Pine.LNX.4.33L2.0304181115200.24211-100000@vipe.technion.ac.il>


I started another international Perl beginners mailing list hosted at
berlios.de:

https://lists.berlios.de/mailman/listinfo/perl-begin-help

I'd appreciate any experienced Perl programmers joining it so beginners
can receive some expert help. And naturally, if you are a beginner and
would like to join - you are more than welcome to do so.

Best regards,

	Shlomi Fish



----------------------------------------------------------------------
Shlomi Fish        shlomif@vipe.technion.ac.il
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish




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

Date: Fri, 18 Apr 2003 11:49:04 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Shlomi Fish <shlomif@vipe.technion.ac.il>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <c78daa13a37ce285b639fea7aa5841ba@news.teranews.com>

>>>>> "Shlomi" == Shlomi Fish <shlomif@vipe.technion.ac.il> writes:

Shlomi> I started another international Perl beginners mailing list hosted at
Shlomi> berlios.de:

Shlomi> https://lists.berlios.de/mailman/listinfo/perl-begin-help

Shlomi> I'd appreciate any experienced Perl programmers joining it so beginners
Shlomi> can receive some expert help. And naturally, if you are a beginner and
Shlomi> would like to join - you are more than welcome to do so.

And please be aware that we already *have* a centrally advertised
"perl beginners mailing list" with international participants
described at <http://lists.perl.org/showlist.cgi?name=beginners>.  The
people answering questions there are of the highest caliber (usually
:), and the list is remarkably high in signal to noise ratio.

There is no need for *another* list.  Shlomi has not demonstrated the
need, except from a selfish "not invented here" position.

Shlomi - you are hurting the community.  Please stop.

print "Just another Perl hacker,"
-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 18 Apr 2003 15:03:28 +0300
From: Shlomi Fish <shlomif@vipe.technion.ac.il>
To: "Randal L. Schwartz" <merlyn@stonehenge.com>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <Pine.LNX.4.33L2.0304181456370.24613-100000@vipe.technion.ac.il>

On 18 Apr 2003, Randal L. Schwartz wrote:

> The following message is a courtesy copy of an article
> that has been posted to comp.lang.perl.misc as well.
>
> >>>>> "Shlomi" == Shlomi Fish <shlomif@vipe.technion.ac.il> writes:
>
> Shlomi> I started another international Perl beginners mailing list hosted at
> Shlomi> berlios.de:
>
> Shlomi> https://lists.berlios.de/mailman/listinfo/perl-begin-help
>
> Shlomi> I'd appreciate any experienced Perl programmers joining it so beginners
> Shlomi> can receive some expert help. And naturally, if you are a beginner and
> Shlomi> would like to join - you are more than welcome to do so.
>
> And please be aware that we already *have* a centrally advertised
> "perl beginners mailing list" with international participants
> described at <http://lists.perl.org/showlist.cgi?name=beginners>.  The
> people answering questions there are of the highest caliber (usually
> :),

I am fully aware of it.

> and the list is remarkably high in signal to noise ratio.
>

This may be true. However, it is also of very high volume. My purpose is
to create another mailing list which users and experts can choose to be
part of as well. Eventually, each list will develop a slightly different
culture and atmosphere. I wish to see other lists as well.

> There is no need for *another* list.  Shlomi has not demonstrated the
> need, except from a selfish "not invented here" position.
>

The need is the high volume of the existing list.

> Shlomi - you are hurting the community.  Please stop.
>

How am I hurting the community? By distributing effort? Do you wish all
the Perl community to concentrate it efforts in a few resources? I
certainly don't, and would like to see something more like VB or PHP (or
something in between).

Regards,

	Shlomi Fish

> print "Just another Perl hacker,"
>



----------------------------------------------------------------------
Shlomi Fish        shlomif@vipe.technion.ac.il
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish



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

Date: Fri, 18 Apr 2003 14:38:45 +0200
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <newscache$lshjdh$ch2$1@news.emea.compuware.com>

Shlomi Fish wrote (Friday 18 April 2003 14:03):

> On 18 Apr 2003, Randal L. Schwartz wrote:
>> print "Just another Perl hacker,"
>
> How am I hurting the community?


Despite his sig, this guy is not "Just another Perl hacker". You are driving
on the left side here. Don't get run over.

-- 
KP



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

Date: Fri, 18 Apr 2003 17:03:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <Pine.LNX.4.53.0304181646250.2389@lxplus082.cern.ch>

On Fri, Apr 18, Shlomi Fish inscribed on the eternal scroll:

> How am I hurting the community?

> I [...]  would like to see something more like VB or PHP (or
> something in between).

I'm tempted to just write "Q.E.D".

It seems you're pursuing your own agenda, leaving me - at least - in
doubt as to whether you'd be genuinely helping "Perl Beginners"
(whatever you might suppose such creatures to be).[1]

I have this sinking feeling that the unstated agenda includes pushing
folks who are complete newbies to any kind of program design or
programming language, out on a narrow plank of developing server-side
Perl scripts for the web, with only the deep ocean beneath.

I personally have nothing against server-side scripts (they can be
much more robust web-engineering than client-size scripts), but they
_are_ a serious undertaking with non-trivial security implications.

IMHO those who are not willing to get up to speed on programming as a
discipline prior to tackling server-side scripting would be better off
using some pre-packaged recipes, which in a sense is what PHP does.
Meantime, on the basis of what you posted, I'm not really tempted to
find out too much more about your splinter list.

The mailing list to which Randal refers has a proven track record, on
the other hand.  "I rest my case".

best regards

[1] There's a big difference between someone who has a grounding
in programming already, and wants to learn Perl as a new programming
language; and someone who's never tackled any kind of programming
before and wants to start it alongside learning Perl.

-- 

            A population of pointy-bearded webmonkeys bouncing
            around on their springy little tails telling the public
            what "HTML" looks like  [...]  does no good for those
            who _do_ know how to do it right.  - Andy Dingley on uk.n.w.a


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

Date: 18 Apr 2003 15:58:44 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <slrnba085k.qf4.abigail@alexandra.abigail.nl>

Shlomi Fish (shlomif@vipe.technion.ac.il) wrote on MMMDXVII September
MCMXCIII in <URL:news:Pine.LNX.4.33L2.0304181115200.24211-100000@vipe.technion.ac.il>:
##  
##  I started another international Perl beginners mailing list hosted at
##  berlios.de:
##  
##  https://lists.berlios.de/mailman/listinfo/perl-begin-help
##  
##  I'd appreciate any experienced Perl programmers joining it so beginners
##  can receive some expert help. And naturally, if you are a beginner and
##  would like to join - you are more than welcome to do so.


I've seen you whining and insulting on a couple of forums the past
few days. You are way past the point I feel any initiative to help
you out.


Goodbye.


Abigail
-- 
perl -wle 'print prototype sub "Just another Perl Hacker" {};'


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

Date: Fri, 18 Apr 2003 14:03:28 GMT
From: "Bob X" <bobx@linuxmail.org>
Subject: Re: Can I die and also write to a log file?
Message-Id: <QATna.827$hT2.648667@news2.news.adelphia.net>

"Sherman Willden" <sherman.willden@hp.com> wrote in message
news:3a80d8d6.0304161141.260da490@posting.google.com...
> Can I use die and also write to a log file? I am using perl perl,
> v5.6.1 built for MSWin32-x86-multi-thread
>
> I quit using die because I had to also write to a log file. I am also
> generating a message that indicates the script and the line number as
> shown in _Progamming Perl, 2nd Edition_, page 157. So I open an error
> log (EL) and write to it like the if statement shown below.
> if ( "$DIR" eq "" ) {
>     print '"', __FILE__, '", line, ', __LINE__, ", Unknown directory
> $DIR\n";
>     print EL '"', __FILE__, '", line, ', __LINE__, ", Unknown
> directory $DIR\n";
>     print "Exiting $0\n";
>     print EL "Exiting $0\n";
>     close(EL);
>     exit 1;
> }
>
> This results in the below message:
> "C:\BuildScripts\V2.1A\Windows\TryExit.pl", line, 15, Unknown
> directory C:\mydir
>
> Is there an easier way?
>
> Thanks;
>
> Sherman

You could create your own 'sub' that gets called when things error out. That
way you can have it do anything you like.




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

Date: 18 Apr 2003 11:04:51 -0700
From: Arduin58@netscape.net (Arduin)
Subject: English --> Orkish text filter
Message-Id: <80d892ce.0304181004.1b1cd6b@posting.google.com>

Free text filter, written using Perl, that converts english to "orkish":

  http://hiddenway.tripod.com/waaagh/orklib.pm.txt

Nothing particularly clever about the source -- it's merely for amusement.
(Similar to the old Swedish Chef and Elmer Fudd filters.)

Note: Too many access attempts to this site might exceed the download limit,
so please be gentle. ;-)

Thanks.

--
  Bob


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

Date: Fri, 18 Apr 2003 09:30:51 -0500
From: "Kevin Vaughn" <kevin.vaughn@ttu.edu>
Subject: Re: Good Programming Practices - Avoiding Memory Leaks
Message-Id: <va0317drp6t008@corp.supernews.com>

Thank you so much for the response.  I appreciate your help.

I'm definitely starting the process anew every five minutes.  The task
scheduler runs the script every five minutes.

I am setting up a test server right now.  I will try to get back here in a
day or so and post whether or not disabling Win32::OLE did the trick.

Below is  the main part of a smaller program that uses Win32::OLE.  Notice
the "OleCleanup" sub routine at the end of the script.  That was my initial
attempt at closing the connection.  If returning a static value as you
mentioned prevents the leak, then how do I go back to using Win32::OLE?
I've searched through the man pages for Win32::OLE, but I wasn't able to
come up with anything else.  Any ideas you have would be greatly
appreciated.

-Kevin

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

$locator = Win32::OLE->CreateObject('WbemScripting.SWbemLocator',
\&OleCleanup) or die "Could not access WMI: \n", Win32::OLE->LastError;
$services = $locator->ConnectServer("$Machine", "root/cimv2", "", "")  or
die "ConnectServer failed: \n", Win32::OLE->LastError;
$coll = $services->InstancesOf( "Win32_PerfRawData_PerfOS_Memory" );

foreach $item ( in( $coll ) )
{
  $name = "$item->{Caption}";
  $usage = "$item->{AvailableMBytes}";
} # end foreach

print "$usage\n$usage\n";

sub OleCleanup {
  $self = shift;
  $self->Quit;
}


"Juha Laiho" <Juha.Laiho@iki.fi> wrote in message
news:b7o4ub$q0$1@ichaos.ichaos-int...
> "Kevin Vaughn" <kevin.vaughn@ttu.edu> said:
> >I'm having a problem with a small memory leak (~20MB/day). I have
> >traced the problem back to my Perl scripts.
> ...
> >I've written a 250 line Perl script and a bunch of smaller scripts that
> >are ~50 lines. All of these scripts run every five minutes, working
> >together to extract WMI information from servers (I'm also running
> >MRTG, which could conceivably be the culprit).
>
> So, are you saying that these scripts (also the 250-liner) are started
> fresh every five minutes (not that they just sleep for five minutes, do
> something, and go to sleep again but do not exit)?
>
> If it is so that the scripts are started fresh, the memory leak is
> not in Perl - but in your OS. Ok, something you do in Perl might be
> triggering the leak, but the leak still is on the OS side - which makes
> the Win32::OLE routines the most probable place of problems. You might
> try to check this by having the same script, but instead of calling
> things through Win32::OLE just return some fixed (or random) data.
>
> And as was mentioned in the other reply, use 'my' for declaring your
> variables, and limit them to the smallest possible scope. This also
> helps to keep your program(s) maintainable (and so do, after you cross
> the initial "pain", turning on warnings and strict). This doesn't help
> much in catching memory leaks, but it might catch some other problems
> that are waiting to bite you.
> --
> Wolf  a.k.a.  Juha Laiho     Espoo, Finland
> (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
>          PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
> "...cancel my subscription to the resurrection!" (Jim Morrison)




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

Date: 18 Apr 2003 16:31:36 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Good Programming Practices - Avoiding Memory Leaks
Message-Id: <slrnba0a38.qf4.abigail@alexandra.abigail.nl>

David James (david@jamesgang.com) wrote on MMMDXVII September MCMXCIII in
<URL:news:bc11859e.0304171908.5f45ab6@posting.google.com>:
## > I'm NOT using strict or declaring variables with "my" (I know this is
## > probably bad, but could it cause leaks?).
##  
##  This will cause memory leaks. Any variable you don't declare with "my"
##  is a package variable. Package variables stick around forever unless
##  you explicitly get rid of them.


That's not a leak, unless the code has a mechanism to construct
variables with new names.

Note that if you call this a leak, my variables leak *as well*.
When leaving a block, Perl doesn't free up all the memory that
makes a variable, because blocks often get reentered (think of
loops and subroutines), and this saves reallocating the memory.



Abigail
-- 
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
   . "\162\1548\110\141\143\153\145\162\0128\177"  and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}


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

Date: 18 Apr 2003 08:25:00 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: GUI Development Options
Message-Id: <1bff1830.0304180725.469d479e@posting.google.com>

"Anthony Saffer" <anthony@nospam.safferconsulting.com> wrote in message news:<3e9eef1c$1_1@nntp2.nac.net>...
> Hello Everyone,
> 
> I'm developing a mid-sized application that will be GUI based using Tk.
> Right now, I'm finding myself hand coding all of the widget data and the
> other code. I'm pretty sure that there is a RAD tool out there that would
> let me design the GUI visually and then concentrate on the backend code
> (something like WinGlade which I can't get to work). Can anyone direct me to
> such a program? I'm on Win32 so it needs to work there.
> 

Check out specperl.  I haven't used it for any real projects but have
tried it out.  It will work on windows, but you will need to install
Tcl/Tk also (ActiveState has a windows binary for Tcl).

http://www.keck.ucsf.edu/~kvale/specperl.html

> Thanks!
> Anthony


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

Date: 18 Apr 2003 04:49:45 -0700
From: spivackm@calib.com (MichaelS)
Subject: Re: Help with script to parse a log file and run a command.
Message-Id: <c5144b08.0304180349.5ec14dfe@posting.google.com>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrnb9k0hc.4ba.mgjv@verbruggen.comdyn.com.au>...
> On 11 Apr 2003 05:49:41 -0700,
> 	MichaelS <spivackm@calib.com> wrote:
> > Hi All,
> > 
> > I am trying to write a shell script to parse through a mysql error log
> > and if it find's a specific error, one to do with replication, that it
> > will run a command to shutdown the current mysql server. 
> 
> \begin{offtopic}
> 
> Have you had a look at swatch? It seems to be the thing that does what
> you are trying to do.
> 
> http://swatch.sourceforge.net/
> 
> \end{offtopic}
> 
> Martien
Thank you very much, I'm first going to try the documentation to see
if I can figure how to do this first.  Then I'm going to try Abigail's
sample script, then I'll try swatch if nothing works.

Thanks again,
Michael


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

Date: 18 Apr 2003 04:56:02 -0700
From: spivackm@calib.com (MichaelS)
Subject: Re: Help with script to parse a log file and run a command.
Message-Id: <c5144b08.0304180356.63df1a0a@posting.google.com>

Abigail <abigail@abigail.nl> wrote in message news:<slrnb9dkoj.9qf.abigail@alexandra.abigail.nl>...
> MichaelS (spivackm@calib.com) wrote on MMMDX September MCMXCIII in
> <URL:news:c5144b08.0304110420.420b9929@posting.google.com>:
> :)  Hi All,
> :)  
> :)  I am trying to write a shell script to parse through a mysql error log
> :)  and if it find's a specific error, one to do with replication, that it
> :)  will run a command to shutdown the current mysql server.  I was
> :)  originally trying to do it with bash and borne shell.  Unfortunately,
> :)  matching regular expressions with bash, especially when there are
> :)  spaces, doesn't work very nice.
> :)  
> :)  Could someone point me to some pointers or examples of how to do this
> :)  in perl.
> :)  
> :)  Essentially, it will parse through the error log file looking for
> :)  "error running query".  If it see's that error, it will run the
> :)  shutdown command for mysql in init.d.  It will also move the error log
> :)  file to a backup location and touch a new one.  If it doesn't see the
> :)  error, the script will simply exit.
> 
> 
> # Untested.
> 
> use strict;
> use warnings;
> 
> my $error_log = "/var/log/mysql/errors";
> 
> open my $fh => $error_log or die "Failed to open $error_log: $!\n";
> while (<$fh>) {
>     if (/error running query/) {
>         close $fh;
>         system "/etc/init.d/mysql" => "stop";
>         warn "Failed to stop mysql, error ", $? >> 8, "\n" if $?;
>         use POSIX 'strftime';
>         my $back = strftime "$errorlog.%Y%m%d:%H%M%S", localtime;
>         rename $error_log => $back or die "Failed to backup errorlog: $!\n";
>         exit 1;
>     }
> }
> exit 0;
> 
> __END__
> 
> 
> Personally, I would do log rotation when starting the service.
> 
> 
> Abigail

Hi Abigail,

Thank you very much for the reply.  When you say to do that log
rotation when starting the service, do you mean manually, or do you
mean in the beginning of the script.  I just don't want another admin
to forget to move the error log and then not be able to start the
mysql service.

-Michael


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

Date: 18 Apr 2003 15:55:40 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Help with script to parse a log file and run a command.
Message-Id: <slrnba07vs.qf4.abigail@alexandra.abigail.nl>

MichaelS (spivackm@calib.com) wrote on MMMDXVII September MCMXCIII in
<URL:news:c5144b08.0304180356.63df1a0a@posting.google.com>:
%%  Abigail <abigail@abigail.nl> wrote in message news:<slrnb9dkoj.9qf.abigail@alexandra.abigail.nl>...
%% > 
%% > Personally, I would do log rotation when starting the service.
%%  
%%  Thank you very much for the reply.  When you say to do that log
%%  rotation when starting the service, do you mean manually, or do you
%%  mean in the beginning of the script.  I just don't want another admin
%%  to forget to move the error log and then not be able to start the
%%  mysql service.


Automated of course.



Abigail
-- 
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
          q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'


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

Date: 18 Apr 2003 10:21:21 -0700
From: daniel@metadot.com (Daniel Guermeur)
Subject: Metadot Portal Server v5.5.2.1 (GPL)
Message-Id: <88b62c96.0304180921.13c9f127@posting.google.com>

Austin, TX – April 18, 2003 – Metadot Corporation, the maker of
Metadot Portal Server software is proud to announce the availability
of its open source Metadot Portal Server v5.5.2.1. providing numerous
new features and usability enhancements, as well as a number of bug
fixes.

Metadot Portal Server is a point-and-click website builder software
for building powerful websites just with the click of a mouse.
Includes content management, collaboration, dashboard like My Yahoo.
Runs on Perl, Apache, Linux and MySQL

Metadot Corporation has also unveiled an improved community website at

http://www.metadot.net

to support open source developers. Metadot Corporation brings the low
cost and high value open source paradigm to the portal application
spaces.

Info and download at http://www.metadot.net

--
Daniel


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

Date: Fri, 18 Apr 2003 15:13:15 GMT
From: "Jolly Joe Jim Bob" <jollyjoejimbob@hotmail.com>
Subject: my cgi works but won't execute external commands such as 'system(mkdir fred)' or 'open (filefandle, ">myfile.txt")'
Message-Id: <fCUna.62245$BQi.36632@news04.bloor.is.net.cable.rogers.com>

below you will find a junk of my code that...

1 collects the data from a form on my webpage
2 makes some folders
3 parses an eps file
4 ouputs files into the above created folders

my problem...
- when executing my script at the command line everything works great, of
course it doesn't collect any data.
- when i post to it via my webpage it does collect the data but does not
exectue parts 2, 3, and 4

when posting to it it's it won't execute anything that goes outside the
realm of the web, to the system.

what gives ?

any suggestions to a solution or a good source of information.

thank you so much for your help ;-)

p.s. this is all being executed on an OS X Server 10.2.5


my code...


#!/usr/bin/perl
require "get_form_data.pl";

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

########################################################################
#
# Getting the data from dataentry01.html
#
########################################################################

&get_form_data;

my $JobNumber = $FORM{'JobNumber'};
my $DocketNumber = $FORM{'DocketNumber'};
my $CustomerName = $FORM{'CustomerName'};
my $Description = $FORM{'Description'};
my $ProductFabricType = $FORM{'ProductFabricType'};
my $ProductWidth = $FORM{'ProductWidth'};
my $ProductHeight = $FORM{'ProductHeight'};
my $ProductQty = $FORM{'ProductQty'};
my $PrintOrientation = $FORM{'PrintOrientation'};
my $ColourQty = $FORM{'ColourQty'};
my $Colour1 = $FORM{'Colour1'};
my $Colour2 = $FORM{'Colour2'};
my $Colour3 = $FORM{'Colour3'};
my $Colour4 = $FORM{'Colour4'};
my $Colour5 = $FORM{'Colour5'};
my $Colour6 = $FORM{'Colour6'};
my $Colour7 = $FORM{'Colour7'};
my $Colour8 = $FORM{'Colour8'};
my $XUp = $FORM{'XUp'};
my $SalesRepID = $FORM{'SalesRepID'};
my $SalesOrder = $FORM{'SalesOrder'};
my $Priority = $FORM{'Priority'};
my $Ship = $FORM{'Ship'};

########################################################################
#
# Making Folder Structure
#
########################################################################

my $mainpath = '/gfx_data/Live/NewOrders/';
my $tempname1 = "$JobNumber-$DocketNumber-$Description";
my $tempname2 = substr($tempname1,0,30);
my $myfolder = "$mainpath$tempname2";

system (mkdir "$myfolder");
system (mkdir "$myfolder/Config Files");
system (mkdir "$myfolder/Customer Files");
system (mkdir "$myfolder/Misc Resources");
system (mkdir "$myfolder/Mockup");
system (mkdir "$myfolder/RIP ME");
system (mkdir "$myfolder/Digital");
system (mkdir "$myfolder/Hard Proof");

########################################################################
#
# Parsing the Illustratore Template
#
########################################################################

my $myBIGScript = "sed -e 's/Description_Data/$Description/g' -e
's/PartID_Data/$JobNumber-$DocketNumber/g' -e
's/Creation_Date_Data/Date/g' -e 's/Modification_Date_Data/Date/g' -e
's/Sales_Rep_Data/$SalesRepID/g' -e 's/Sales_Order_Data/$SalesOrder/g' -e
's/Fabric_Data/$ProductFabricType/g' -e 's/Ship_Date_Data/$Ship/g'
'/gfx_data/Live/templates/mocktemplate' >
'$myfolder/Mockup/$DocketNumber-Mockup'";

system ($myBIGScript);

########################################################################
#
# Output file for AppleScript into various folders
#
########################################################################

my $outputfile = "$myfolder/Config Files/$JobNumber.txt";
open (OUTPUTFILE1, ">$outputfile");
print OUTPUTFILE1 "$JobNumber\n";
print OUTPUTFILE1 "$DocketNumber\n";
print OUTPUTFILE1 "$CustomerName\n";

and so on ...





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

Date: 18 Apr 2003 06:49:58 -0700
From: scott@doppelgangerdesign.com (Scott Spencer)
Subject: Re: Need advice on my first Perl script
Message-Id: <d88b4984.0304180549.6e654951@posting.google.com>

Thank you both for the great advice. Im sorry I didnt read the posting
guidelines... I will check the documentation that was reccomended and
look into some more "beginner" oriented lists.

thanks again! 

Scott 

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnb9v2r2.96s.tadmc@magna.augustmail.com>...
> Scott Spencer <scott@doppelgangerdesign.com> wrote:
> 
> > keep only every 5th or 6 th file deleting the ones in between. For
> > instance, file001 will stay but file 002 thru 005 will be deleted. I
> > know its bad form to delete the files 
> 
> 
> I don't know that.
> 
> Why is it bad form to delete the files?
> 
> 
> > but it was the first and only
> > solution I found in my book. 
> 
> 
> If it does not do what you _want_ to do, then it is not a 
> "solution" at all...
> 
> 
> > this is my first time ever
> > coding Perl so... : )
> 
> 
> ... so have you read the Posting Guidelines that are posted
> here frequently?
> 
>    http://mail.augustmail.com/~tadmc/clpmisc.shtml
> 
> 
> 
> > opendir (BOOGER, "$path") || die "cannot open your request??? $!"; 
>                    ^     ^
> 
> Those quotes do not do anything, so they should not be there.
> 
> It would be helpful if your diagnostic message actually said
> what directory it tried to open:
> 
>    opendir(BOOGER, $path) or die "cannot open '$path'  $!";
> 
> 
> > @thefiles = readdir(BOOGER); 		#read the directory contents into an
> 
> 
> You know that @thefiles might contain things that are NOT files, right?
> 
> Like directories, symlinks, etc...
> 
> If you want only plain files, you can use grep and a filetest:
> 
>    @thefiles = grep -f "$path/$_", readdir(BOOGER);
> 
> and now that you are done with the directory handle, you
> should free that resource:
> 
>    closedir BOOGER;
> 
> 
> > #and the script itself which onloy seems to work
> > when it is in the home #directory. I think thats cause I used the
> > unlink function.
> 
> 
> No, that is because you did not read the documentation for
> the functions that you are using.
> 
> You should read the documentation for the functions that you use:
> 
>    perldoc -f readdir
> 
>        if you're planning to filetest the return values
>        out of a "readdir", you'd better prepend the
>        directory in question.  Otherwise, because we
>        didn't "chdir" there, it would have been testing
>        the wrong file.
> 
> It is looking for the files in the current directory, but they
> are not in the current directory, they are in the directory
> that you opendir()ed.
> 
> 
> > while ($current_count ne $end_frame)  {
>                         ^^
> 
> ne is for comparing _strings_.
> 
> If you want to compare numbers, you use != instead.
> 
> 
> > 	$current_file = @thefiles [$current_count]; 
> 
> 
> If you had enabled warnings it would have said something about
> that line.
> 
> Ask for all the help you can get.
> 
> You should always enable warnings when developing Perl code!
> 
> 
> >         $current_file_number = $current_file;
> > 	$current_file_number =~ s/\D*//;  #regular expression to remove all
> > #alpha characters before numbers
> 
> 
> Your comment is misleading as it will remove the first run of non-digits
> (not "all" non-digits) regardless of whether they appear before or
> after digit characters.
> 
>    s/^\D+//;  # remove all non-digits from start of string
> 
> 
> > # I need to figure out the regular expression to wipe the .tif
> > extension as #well.
> 
>    s/\.tif$//;  # remove the .tif extension
> 
> 
> > 	unlink ($current_file);
> 
> 
> Just because you asked for the file to be deleted does not mean
> you got what you asked for.
> 
> You should check the return value to see if you got what you asked for:
> 
>    unlink($current_file) or die "could not unlink '$current_file'  $!";
> 
> 
> > 	print '\n';
> 
> 
> I'll bet that does not do what you think it does...


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

Date: Fri, 18 Apr 2003 09:58:03 +0200
From: "Eddy" <eddy@NOSPAMaxa.it>
Subject: Re: newbie lib dir question
Message-Id: <b7ob5s$745$1@lacerta.tiscalinet.it>

Well,

If  I delete the old libs look what happens with apache:

[root@www /]# mv /usr/lib/perl5 /usr/lib/00perl5
[root@www /]# /etc/rc.d/init.d/httpd restart
Shutting down http:                                        [  OK  ]
Starting httpd: Can't locate Cwd.pm in @INC (@INC contains:
/usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .)
at (eval 1) line 1.
                                                           [FAILED]
[root@www /]# mv /usr/lib/00perl5/ /usr/lib/perl5
[root@www /]# /etc/rc.d/init.d/httpd restart
Shutting down http:                                        [FAILED]
Starting httpd:                                            [  OK  ]

as you can see the error reports another @INC;

I have found also that I have multiple copies of perllocal.pod -->

[root@www /]# locate perllocal.pod
/usr/lib/perl5/5.00503/i386-linux/perllocal.pod
/usr/lib/perl5/site_perl/5.005/i386-linux/perllocal.pod
/usr/local/lib/perl5/5.8.0/i686-linux/perllocal.pod
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/perllocal.pod

other Perl programs are not functioning properly (openwebmail): I am pretty
sure that my Perl installation its seeking for wrong version of libraries,
but I can't simply delete them because other programs use them.

Eddy
(start hating rpm system!)

"Knute Snortum" <knuteNOSPAMPLEASE@trinityproject.org> ha scritto nel
messaggio news:ZqKna.30261$Zx.21641@nwrddc01.gnilink.net...
> I don't see what's wrong.  It looks like you @INC is using all the new
libs
> like it should.  What problems are you experiencing?
>
> --
> -- Knute Snortum
> "Sure, I drink six 8-ounce glasses of water a day.  I just like my water
> hot and filtered through ground coffee beans."
>
>
> "Eddy" <eddy@NOSPAMaxa.it> wrote in message
> news:b7ndsj$1fv$1@lacerta.tiscalinet.it...
> > On my RH 6.2 I have tryed to upgrade Perl to 5.8 with source version
> >
> > It seems that the lib directories have mixed together  with the old rpm
> > version from redhat:
> >
> > /usr/local/lib/perl5/5.8.0/
> >
> > and
> >
> > /usr/lib/perl5/5.00503/
> > /usr/lib/perl5/site_perl/5.005/i386-linux/
> >
> > perl -V says:
> > @INC:
> >     /usr/local/lib/perl5/5.8.0/i686-linux
> >     /usr/local/lib/perl5/5.8.0
> >     /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
> >     /usr/local/lib/perl5/site_perl/5.8.0
> >     /usr/local/lib/perl5/site_perl
> >
> > How can I "clean up" everything?
> > "rpm -e perl " fails because everything depends on perl,
> > how can I set @INC?
> >
> > thank you
> > Eddy
> >
> >
> >
> >
>
>




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

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


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