On Mon, 29 Jul 2002, Janek Schleicher wrote:
>
> > 1.) First of all, I'm unhappy with the '~' I had to plug in so $funcs{$func}~[$1]
>would not be
> > considered as a ref to an array. Is there a better way to stop Perl from
>misinterpreting this? I
> > need the []-braces since arguments to func
Does anyone know a way to create graphic menu's without running X. I know curse can do
it. But I need something more lively.
Thanx,
Mark
Hello,
I would like to clean up my logfile directory by removing files that are older than 7
days.
So I wrote something like:
/user/local/bin/perl -w
use strict;
use FindBin qw($Bin);
#
`find $Bin -mtime +7 -name '*.log' -exec rm {} \;`;
#
__END__
My question is: how can I use perl's synthax i
You should be able to do it with
opendir (to open directories and browse the contents)
and
unlink (to delete files)
take a look at the man pages for those two to get you started, if
you're still struggling just ask again.
HTH
Nigel
>>> "NYIMI Jose (BMB)" <[EMAIL PROTECTED]> 07/29/02 08:37am
You can use the File::Find module. It even has a find2perl utility for
taking the work of writing a matching subroutine out:
Then you get something like
#!/usr/local/bin/perl -w
use strict;
use FindBin qw{$Bin};
use File::Find;
find(\&wanted, $Bin);
sub wanted {
(my ($dev,$ino,$mode,$nl
Ok, but how can I check the age of file ?
Because I need to "unlink" only files older than 7 days ...
Should I use something like :
unlink $filename if(-M $filename > 7)
José.
-Original Message-
From: Nigel Peck [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:15 AM
To: [EMAIL
Thanks George,
I will try ...
José.
-Original Message-
From: George Schlossnagle [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:27 AM
To: NYIMI Jose (BMB)
Cc: [EMAIL PROTECTED]
Subject: Re: Avoid using backticks
You can use the File::Find module. It even has a find2perl ut
I get some output in the COMMAND filehandle, as you see i try to dont show it by
hiding it into an $output , then while the COMMAND is running i want perl to
interactivly examine the $output and seach for 10% if its there is should only print
that to the screen. now it still prints all the $_
Scott Wahlstrom <[EMAIL PROTECTED]> wrote:
> Upon running
>
> #nada> perl -MCPAN -e shell
>
> a configuration file was changed...whats the name of this file?
~/.cpan/CPAN/MyConfig.pm
But if you run it as root (tsk) the system-wide one gets changed:
#!/usr/bin/perl -l
# whence the CPAN
On Mon, 29 Jul 2002, David Samuelsson (PAC) wrote:
> I get some output in the COMMAND filehandle, as you see i try to dont show it by
>hiding it into an $output , then while the COMMAND is running i want perl to
>interactivly examine the $output and seach for 10% if its there is should only pr
Hello, I have a short Question,
which module can I use to work with imap-email?
Big thanks for helping me out.
Bastian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
>>> On Mon, 29 Jul 2002 11:40:04 +0200, "Angerstein" <[EMAIL PROTECTED]> said:
ang> Hello, I have a short Question, which module can I use to work
ang> with imap-email?
Net::IMAP, Net::IMAP::Simple, Mail::IMAPClient. Whichever you want.
In future, you can answer questions like these with
On Mon, 29 Jul 2002, Angerstein wrote:
>
> Hello, I have a short Question,
> which module can I use to work with imap-email?
http://search.cpan.org/search?dist=Mail-IMAPClient.
For all your module needs search.cpan.org is the place to look into
>
> Big thanks for helping me out.
>
> Bastian
David Samuelsson wrote:
>
> I get some output in the COMMAND filehandle, as you see
> i try to dont show it by hiding it into an $output , then
> while the COMMAND is running i want perl to interactivly
> examine the $output and seach for 10% if its there is should
> only print that to the scree
Is there a perl module which will allow me to perform an OCR type of
'decoding' of text pages which have been scanned into a multi-page
tiff-image?
Christian
**
This e-mail and any files transmitted with it
Hey guys,
I am having trouble when accessing cookies we've created. I am using =
CGI::Cookie in a script to generate the cookie and send it to the browser. =
This seems to work fine, as the cookie is then saved and I can see it in =
my local Cookies folder on my computer. However, when using the
Hello Listers,
Could someone answer this for me please, I have written a script to rename a
logfile (text file). I have used the rename function - but the documentation
warns of issues depending on OS patform and then links to Win32:Copyfile and
mentions having to unlink yourself.
This is all fin
Todd, et al --
...and then Todd Wade said...
%
% "David T-G" <[EMAIL PROTECTED]> wrote in message
% [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
%
% >Sorry for the interruption, everyone.
% >
% >Chris, your email address (@home.com) is dead. Would you mind fixing it?
%
% Since you are asking
If you are using a Apache server on Win32, the log file will be LOCKED during its
running.
So you cannot rename, unlink or open for edit on it. you can only open it for read
only.
Maybe you can copy, I don't know.
rename ($file, $newfile) or die ".. $!"; # may help to see what's the problem
Hello,
I try to initialyze the key'hash :
my %Slices ;
open( FH_DF, system( "df -k -F ufs | cut -c 56-100" ) ) ;
while ( )
{
$Slices{$key} = '$_' ;
}
Output will be like that :
/
/usr
/home
/opt
That don't work correctly ...
I need first to initialize the key and in a second loop the bac
On Jul 29, Jean Berthold said:
>open( FH_DF, system( "df -k -F ufs | cut -c 56-100" ) ) ;
open() doesn't work like that. Or, more to the point, system() doesn't
work like that. system() executes a command, and anything the commands
prints gets printed. You want:
open FH_DF, "df -k -F ufs |
I'm facing what I believe to one of the classic text manipulation
problems, transforming a document which was typed with a hard return at
the end of every physical line, and two consecutive newlines to mark the
end of a paragraph.
Would anyone help me write a program which would transform these
d
> -Original Message-
> From: Tara Calishain [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 28, 2002 5:28 PM
> To: [EMAIL PROTECTED]
> Subject: comparing to everything in an array?
>
>
> Gentle Perl people,
>
> Sorry to bother you with this, but I can't find the answer in
> my Pile of
Hello all,
Well, I've got a very simple problem and can't seem to get the answer I
want.
Basically I just want to find the previous hour in one of my scripts.
This code does it, but I need to maintain the format "09".
$hour = (localtime)[2];
$hour--; #adjust hour to previous
I know about us
Thanks. Here is what I am trying to accomplish:
$foo = "something";
$bar = "\${foo}";
$bar =~ s/\$\{\(\w+)\}/$$1/g;
print $bar;
OUTPUT:
something
I am getting an error:
Can't use string ("something") as a SCALAR ref while "strict refs" in use at
.. . .
Thanks.
Jess
-Original Message
From: "KEVIN ZEMBOWER" <[EMAIL PROTECTED]>
> I'm facing what I believe to one of the classic text manipulation
> problems, transforming a document which was typed with a hard return
> at the end of every physical line, and two consecutive newlines to
> mark the end of a paragraph.
>
> Would anyo
on Mon, 29 Jul 2002 15:33:19 GMT, [EMAIL PROTECTED] (Kevin Old)
wrote:
> This code does it, but I need to maintain the format "09".
>
> $hour = (localtime)[2];
> $hour--; #adjust hour to previous
>
> I know about using printf, but I don't need to print this value.
> I need to use it as a va
On Jul 29, KEVIN ZEMBOWER said:
>I'm facing what I believe to one of the classic text manipulation
>problems, transforming a document which was typed with a hard return at
>the end of every physical line, and two consecutive newlines to mark the
>end of a paragraph.
>
>Would anyone help me write
Hi All
Scuse my ignorance (and illiteracy) but what is munging? It seems to
crop-up occasionally and I have absolutely no clue...
Cheers
James
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
James Campbell
Research Bioinformatician
Proteome Sciences
Institute of Psychiatry
S
On Jul 29, KEVIN ZEMBOWER said:
>Would anyone help me write a program which would transform these
>documents? I'm trying to find all instances of a single newline, and
>remove it, either inserting or removing space characters around where it
>was to leave just one space between what was the two l
Hello everyone,
I am not too sure if this is the place to send this question or not,
but here it goes anyway:
I have a script that uses the Net::SSH::Perl modules for connecting
to a server. I connect and grab all the databases and put them into an
array. Latter in the script I run a f
Then you should look into sprintf(), which just returns the result.
$oneHourAgo = sprintf("%02d",$hour--);
I think.
-Original Message-
From: Kevin Old
To: [EMAIL PROTECTED]
Sent: 7/29/02 8:33 AM
Subject: Calculate previous hour?
Hello all,
Well, I've got a very simple problem and ca
On Jul 29, James Campbell said:
>Scuse my ignorance (and illiteracy) but what is munging? It seems to
>crop-up occasionally and I have absolutely no clue...
I've got an article in the July "Linux Magazine" ("Hitting the
Motherlode") about regexes (mainly in Perl). In it, I use the term
"munge".
>From Data Munging with Perl web site,
http://www.manning.com/cross/
"Your desktop dictionary may not include it, but 'munging' is a
common term in the programmers world. Many computing tasks require
taking data from one computer system, manipulating it in some way,
and passing it to another.
On Jul 29, Timothy Johnson said:
>$oneHourAgo = sprintf("%02d",$hour--);
You'd want --$hour, but what happens at midnight? What is -1 o'clock?
$prev_hour = sprintf "%02d", --$hour % 24);
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time - (1 * 60 * 60));
print sprintf("%02d%02d%02d", $hour,$min,$sec);
On 29 Jul 2002 11:33:19 -0400, [EMAIL PROTECTED] (Kevin Old) wrote:
>Basically I just want to find the previous hour in one of my scripts.
--
To unsubscr
On Monday, July 29, 2002, at 08:57 , James Campbell wrote:
[..]
> Scuse my ignorance (and illiteracy) but what is munging? It seems to
> crop-up occasionally and I have absolutely no clue...
I believe the term you may know is 'bodging' and/or 'mucking about'
cf:
http://www.manning.com/c
On Monday, July 29, 2002, at 06:49 , Christian Andreassen wrote:
> Is there a perl module which will allow me to perform an OCR type of
> 'decoding' of text pages which have been scanned into a multi-page
> tiff-image?
do you mean:
a) a way to filter the 'scanning' data stream from a
Something like this should work. It takes the hour as an optional argument,
but defaults to the current hour if no parameter is supplied. The optional
argument makes it easier to test and makes it possible to use an hour of a
different timezone.
print last_hour(), "\n"; # current hour minus 1
Kevin Zembower wrote at Mon, 29 Jul 2002 17:19:46 +0200:
> I'm facing what I believe to one of the classic text manipulation problems,
>transforming a
> document which was typed with a hard return at the end of every physical line, and
>two consecutive
> newlines to mark the end of a paragraph.
also a recursive definition...
MUNG = MUNG Until No Good, where you need to expand it again...
MUNG = MUNG Until No Good = MUNG Until No Good
so, w/o an ascii art, you see where the definition of mung is
recursive...
Jim
James Campbell wrote:
>
> Hi All
>
> Scuse my ignorance (and illiterac
The good old Jargon Lexicon defines it as the others, but adds a little history:
http://www.tuxedo.org/%7eesr/jargon/html/entry/munge.html
"This term is often confused with mung, which probably was derived from it. However,
it also appears the word `munge' was in common use in Scotland in the 1
Hello,
I am brand new to Perl and I am trying to get a CGI script for a guestbook
to work and I need some help.
I enter my data on the form, but when I press the submit button, the
guestbook is displayed but the guest information that was entered is not.
Can you take a look at my code and tel
Hello,
I am brand new to Perl and I am trying to get a CGI script for a guestbook
to work and I need some help.
I enter my data on the form, but when I press the submit button, the
guestbook is displayed but the guest information that was entered is not.
Can you take a look at my code and tel
So it turns out I've been munging for a little while and never even knew it!
Thanks for all your replies everyone.
James
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
James Campbell
Research Bioinformatician
Proteome Sciences
Institute of Psychiatry
South Wing Lab
PO BOX P
Hello,
Sorry for sending this so many times, but I don't think the attachment
containing the code was sent. So I pasted the code within this message at
the bottom.
I am brand new to Perl and I am trying to get a CGI script for a guestbook
to work and I need some help.
I enter my data on the
Weekly posting statistics for perl.beginners - week 30 of 2002.
>From Monday 2002-07-22 to Sunday 2002-07-28 there were
430 articles posted (20001 lines) by 117 authors, giving an average
3.68 articles per author, and an average article length of 47 lpa.
The average number of articles per day w
John, ...
Thanks for your suggestionsI would like to take each old filename
('ex020525.log' or exyymmdd.log...) and output
'exyymmdd.new' or even 'exyymmdd.log.new'
> How are the new file names defined? Are they based on the old file
> names or something else?
>
> open IN, $old_filename
Is there a way to feed a switch to a PerlApp generated .exe?
I have a perl script that takes some command line arguments:
For instance "perl -s myscript.pl -g -f"
But when I generate a myscript.exe from PerlApp, the switches no longer
function...
i.e. "myscript.exe -g -f "
A work aroun
I use switches with my PerlApp .EXEs all the time. What are you using to
handle the switches, GetOpt::XXX or a homegrown solution?
-Original Message-
From: Robert Smith [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:27 AM
To: [EMAIL PROTECTED]
Subject: PerlApp and commmand li
Hi,
I am trying out some scripts using lib-www perl (LWP) module.
Unfortunately i am behind a firewall and our network uses a proxy. I am
using the following script to fetch a page and display the contents. It
does not work, the error message says:
"501 (Not Implemented) Protocol scheme '' is n
On Mon, Jul 29, 2002 at 12:07:05PM -0400, Jeff 'japhy' Pinyan wrote:
>
> I've got an article in the July "Linux Magazine" ("Hitting the
> Motherlode") about regexes (mainly in Perl). In it, I use the term
> "munge". FOLDOC[1] says "a derogatory term meaning to imperfectly
> transform data", bu
On Jul 29, Paul Tremblay said:
>On Mon, Jul 29, 2002 at 12:07:05PM -0400, Jeff 'japhy' Pinyan wrote:
>
>> I've got an article in the July "Linux Magazine" ("Hitting the
>> Motherlode") about regexes (mainly in Perl). In it, I use the term
>> "munge". FOLDOC[1] says "a derogatory term meaning to
@tm = localtime(time);
$hour = $tm[2] - 1;
$hour = 23 if $hour < 0;
$hour = '0'.$hour until length($hour) == 2;
print $hour;
Rgds,
Connie
>
> Basically I just want to find the previous hour in one of my scripts.
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai
>The code is as follows:
>
>#!/usr/bin/perl
>use LWP::UserAgent;
>$ua = LWP::UserAgent->new;
>#$ua->env_proxy; # initialize from environment variables
>$ua->proxy(ftp => '172.16.0.1');
>$ua->proxy(http => '172.16.0.1');
>#$ua->no_proxy(qw(no se fi));
>my $req = HTTP::Request->new(GET => 'http://w
Hi,
I tried it once more after including use HTTP:Request; It gives the same
error message
Senthil
>
> this is going to sound absolutely retarded, but did you include
>
> use HTTP::Request;
>
> in your code? =)
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-
Okay, trying Getopt::Long...
Running: "perl -s testOptions.pl --graphical"
produces...
><
><
I'm expecting
><
>1<
#Code sample:
use strict;
use warnings;
use diagnostics;
use Getopt::Long;
my $verbose = ''; # option variable with default value
(false)
my $graphical = '';
Hi guys,
I recieve an email in the following format:
Dear Name,
yara
yara
yars
I need to insert a paragraph, right after word Dear
Name, e.g.
Dear Name,
NEW_PARAGRAPH
yara
yara
I am trying to use seek, but it doesn't work for some
reason:
open(ORIG_FILE, ">>$origFile") or die "cannot append";
s
On Jul 29, Robert Smith said:
>Running: "perl -s testOptions.pl --graphical"
Don't use the -s switch to Perl if you're using a module to support
command-line options.
-s gets them first, and removes them from @ARGV (or rather, they never
make it to @ARGV).
If you print ${-graphical} in your pr
I could be wrong but I don't believe seek will help anyway. I would think
that if you did get the file pointer where you want it, and then started
printing, that you would only overwrite the rest of the file. I assume that
isn't what you intend.
If you want to try anyway, you will need to open t
Kevin Zembower wrote:
>
> I'm facing what I believe to one of the classic text manipulation
> problems, transforming a document which was typed with a hard return at
> the end of every physical line, and two consecutive newlines to mark the
> end of a paragraph.
>
> Would anyone help me write a
Rob E McCormick wrote:
>
> > How are the new file names defined? Are they based on the old file
> > names or something else?
> >
> > open IN, $old_filename
> > or die "cannot open $old_filename for reading: $!";
> > open OUT,">$newdir/$with_new_filename"
> > or die "cannot create $newdir
Paul, et al --
...and then Paul Tremblay said...
%
% On Mon, Jul 29, 2002 at 12:07:05PM -0400, Jeff 'japhy' Pinyan wrote:
%
...
% > "munge". FOLDOC[1] says "a derogatory term meaning to imperfectly
% > transform data", but I don't think it's such a bad term.
% >
% > For me, munge just means u
> -Original Message-
> From: Senthil Kumar M. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 2:37 AM
> To: [EMAIL PROTECTED]
> Subject: Fetching web pages and displaying as text
>
>
> Hi,
>
> I am trying out some scripts using lib-www perl (LWP) module.
> Unfortunately i am
> -Original Message-
> From: lz [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 29, 2002 3:19 PM
> To: [EMAIL PROTECTED]
> Subject: inserting in the middle of the file
>
>
> Hi guys,
>
> I recieve an email in the following format:
> Dear Name,
> yara
> yara
> yars
>
> I need to insert
Hello all,
I have a client with data that looks like this:
Col1 Col2 Col3 Col4
547 CHAN7 B 132 10757N/A WIDE STAND C
548 CHAN7 A 111 10758N/A WIDE STAND C
549 CHAN7 B90 10759N/A WIDE STAND C
54 19 CHAN7 A69 10763
What constitutes a set of data?
Set 1:54, 7 thru 9
Set 2:54,19 thru 23
or
Set 1:54, 7 thru 23
Wags ;)
-Original Message-
From: Kevin Old [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 15:19
To: [EMAIL PROTE
Hello.
I need help ( you figure ?)
#!/usr/bin/perl
use strict;
use Cwd;
my $phone_book = qw{
Fred 0123
John 4567
Bill 8901
};
my $selection = 1;
do {
print "\n Please select one choice";
print "\n 1. Enter name.";
print "\n 2. Quit.\n";
chomp(my $selection = );
if ($selection eq "
On Monday, July 29, 2002, at 04:05 , Tómas Guðmundsson wrote:
[..]
> #!/usr/bin/perl
> use strict;
> use Cwd;
>
> my $phone_book = qw{
> Fred 0123
> John 4567
> Bill 8901
> };
you might want to think of using a hash here
instead of a straight array, hence
my %phone_book = (
Fred => 012
Path problem possibly?? WHen creating a cookie you may pass it a path
so that only scripts located under that path then receive the cookie
from the browser, I believe it defaults to the current level of the
*setting* script, are both your scripts being called from the same
place, and/or are y
On Sat, Jul 27, 2002 at 02:40:52PM -0700, John W. Krahn wrote:
>
> s[([&<>]|(?<=\\)$rx)][$rep{$1}]go;
>
John, this doesn't work.
My representative line is:
\ldblquote \rdblquote & < > \par
My code is:
my %rep = qw(
& &
> >
Kevin Old wrote at Tue, 30 Jul 2002 00:19:24 +0200:
> Hello all,
>
> I have a client with data that looks like this:
>
> Col1 Col2 Col3 Col4
> 547 CHAN7 B 132 10757N/A WIDE STAND C 548 CHAN7 A
>111 10758 N/A
>WIDE STAND C 549 CHAN7 B90 107
Drieux wrote at Tue, 30 Jul 2002 02:51:27 +0200:
> On Monday, July 29, 2002, at 04:05 , Tómas Guðmundsson wrote: [..]
>> my $phone_book = qw{
^
>> Fred 0123
>> John 4567
>> Bill 8901
>> };
>
> you might want to think of using a hash here
> instead of a straight array, hence
>
> my
I want to extract the 'text' from the image. The image could be a scanned
report or a fax etc... i.e your option 'b'
Christian:-)
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: 29. juli 2002 18:14
To: begin begin
Subject: Re: OCR and perl..
On Monday, July 29, 2002,
my $num = 100; # or whatever integer;
$num = reverse($num);
$num =~ s/(\d{3})/$1,/g;
chop $num if $num =~ /,$/;
$num = reverse($num);
print $num;
I have this script to make an integer with comma at every 3 digits, from right to left.
(What should this presentation way name actaully ?? ) Li
75 matches
Mail list logo