danield writes:
> Hello all,
>
> I am looking for help with creating a digest of a log file. I have found
> a nice tutorial that should help on
> http://www.pageresource.com/cgirec/ptut14.htm. However, this tutorial
> expects to have values in list separated by | :
>
> he Rock|Cheer|Roc
Hello all,
I am looking for help with creating a digest of a log file. I have found
a nice tutorial that should help on
http://www.pageresource.com/cgirec/ptut14.htm. However, this tutorial
expects to have values in list separated by | :
he Rock|Cheer|Rock Bottom
Triple H|Boo|Pedigree
Stone Col
[EMAIL PROTECTED] wrote:
> Help. I'm a frustrated newbie who wants to use Perl to make my life easier.
>
> The following simple task is only one small part of a program I'm trying to
> put together to automate some things I currently do manually.
>
> I have a file whose format looks like this:
>
>
To just use it for STDOUT, it's pretty straight forward, switching the
special $~ variable as needed.
You're switching FORMATs not filehandles. There may be a shortcut but this
is how I would do it for this problem:
-Tom Kinzer
_
format TYPE_1 =
Im formated with type1: @<<<
drieux wrote:
> Or we might use say
>
> $_ =~ s|\s*_<|<|g;
>
> to clean out the preceeding 'white space'...
>
> ciao
> drieux
I don't think so. That would be profoundly rude. One of the traditional
courtesies of the HTML protocols was [it is now, like most courtesy ,
honored more in the
Eamon Daly wrote:
> Hi, all. I'm using Imager to create gifs, but the resultant
> file sizes are /huge/. I'm writing the files out like so:
Are you doing animations? If not, skip the GIFs. You can get much
better depth [16 million] in a lot less space with JPEG files.
Some of the compression al
Is it possible to use more than one format in a script? I am parsing a log file to
STDOUT and would like to be able to write to two (or more) different formats depending
on the information found in the log.
This is what I'm trying to do:
1. open and read logfile
2. if you find "some_string" pr
Good news, Dan.
That is arguably one of Perl's most famous features!
Regular expresions (Perl's own) are very similar to what you would do with
sed, if you are familiar with that.
open IN, "< $input" or die "Unable to open $input for reading, $!,
stopped";
open OUT, "> $output" or die "Unable
I went back to my books to refresh my memory on how to use references. Your
suggestion help a lot, but the subroutine returns wrong values. I did
some small modifications on the codes below
, and tried it. It return perl-5.8.0-80.3.i386.rpm and
samba-2.2.7-5.8.0.i386.rpm, which is wrong because:
[EMAIL PROTECTED] wrote:
> I have a script that reads text from a file and inserts text
> into different places depending on what it needs to do. But I use
> split to replace the text, i.e.:
>
> ($first_part, $second_part) = split "#INSERT#TEXT#HERE#", $document,
> 2; print FILEHAND
Hi Dan,
have you tried using a regular expression?
I am using something like this for a similar purpose:
open ($fh, $filename);
# go through each line of the file
while ($_ = <$fh>) {
# replace globally in the default variable $_
s/#INSERT#TEXT#HERE/$text_to_insert/g;
}
close ($fh);
I have a script that reads text from a file and inserts text
into different places depending on what it needs to do. But I use
split to replace the text, i.e.:
($first_part, $second_part) = split "#INSERT#TEXT#HERE#", $document, 2;
print FILEHANDLE $firstpart, $text_to_insert, $sec
> Hi there,
>
Howdy,
>Which modules i have to install in order to connect
> perl with mysql ?, in what order ?, My perl
Excellent choice of combo! You'll want to install DBI
It should come witht the mysql driver automatically.
> installation is on solaris 9. I already have mysql
> instal
What are you looking for?
IP addresses for machines?
Live IP Addresses?
Physical Machines?
DNS Information?
DHCP Machines?
Ethernet NIC Addresses?
or some combination?
What network structure are you using?
NetBeui?
TCP/IP?
Hi there,
Which modules i have to install in order to connect
perl with mysql ?, in what order ?, My perl
installation is on solaris 9. I already have mysql
installed. Thanks for the help.
Joe EchavarrÃa.
__
Do you Yahoo!?
Free Pop-Up Blocker - Get it n
Thanks - exactly what I was looking for.
-Phil
> Well, this:
>
> http://docs.sun.com/db/doc/805-6332/6j5vhemob?q=Perl&a=view
>
> Suggests that Solaris 8, at least more recent versions of it, are
> shipped with 5.005_03. Whether or not a particular package has been
> installed is probably up to t
On Dec 5, 2003, at 11:09 AM, [EMAIL PROTECTED] wrote:
[..]
You guys make it look so easy !
just think how weird you will be when your copy
of Programming Perl 3rd Edition is the coffee
stained collector's item right next to our
copies of Programming Perl - the Pink Book -
that was the first edition
Thanks to all with the quick responses and possible solutions for splitting
my names list into one name per line. I've tried a couple of them and they
work great. You guys make it look so easy !
Using an array with 'Split' seemed to be a key part of the solution. I
guess I was sort of on th
> Hi all,
>
> I'm trying to figure out exactly what I need to support and I'm getting
> conflicting inputs. Perhaps someone can shed some light on the subject.
>
> I'm trying to determine which version of perl ships by default with
Solaris 8.
> I've been told two things: perl 5.005 and "no
On Dec 5, 2003, at 10:19 AM, Phil Schaechter wrote:
[..]
I'm trying to determine which version of perl ships
by default with Solaris 8. I've been told two things:
perl 5.005 and "no perl is installed by default" -
both of which I find hard to believe.
The official answer is 'yes'.
It is possible
does anyone know how to generate a java script alert window in perl? Or
better a alert window generated by perl. Its for a field validation in a
form...html
-Original Message-
From: david [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 2:06 PM
To: [EMAIL PROTECTED]
Subject: Re: F
On Friday 05 December 2003 10:53, [EMAIL PROTECTED] wrote:
> My next Perl task after I get my list of one name per line, is to sort the
> list and eliminate duplicate names.
I have used the following script to sort and remove duplicate entries in flat
text files.
http://www.downloaddatabase.com/
Stuart Clemons wrote:
>
> I have a file whose format looks like this:
>
> name1 name2 name3
> name4 name5 name6, etc.
>
> The names are separated by spaces. I need the names to be one name per
> line, like this:
>
> name1
> name2
> name3, etc.
try:
[pand
[EMAIL PROTECTED] wrote:
> Help. I'm a frustrated newbie who wants to use Perl to make my life
> easier.
>
> The following simple task is only one small part of a program I'm
> trying to put together to automate some things I currently do
> manually.
>
> I have a file whose format looks like th
On Dec 5, 2003, at 9:53 AM, [EMAIL PROTECTED] wrote:
[..]
I'm trying to
put together to automate some things I currently do manually.
I have a file whose format looks like this:
name1 name2 name3
name4 name5 name6, etc.
The names are separated by spaces. I nee
>
> Help. I'm a frustrated newbie who wants to use Perl to make my life
easier.
>
> The following simple task is only one small part of a program I'm
trying to
> put together to automate some things I currently do manually.
>
> I have a file whose format looks like this:
>
> name1 name
> I have a file whose format looks like this:
>
> name1 name2 name3
> name4 name5 name6, etc.
>
> The names are separated by spaces. I need the names to be
> one name per
> line, like this:
>
> name1
> name2
> name3, etc.
>
Here is one way:
while (<>) {
[EMAIL PROTECTED] wrote:
> Help. I'm a frustrated newbie who wants to use Perl to make
> my life easier.
>
> The following simple task is only one small part of a program
> I'm trying to
> put together to automate some things I currently do manually.
>
> I have a file whose format looks like this
Hi all,
I'm trying to figure out exactly what I need to support and I'm getting
conflicting inputs. Perhaps someone can shed some light on the subject.
I'm trying to determine which version of perl ships by default with Solaris 8.
I've been told two things: perl 5.005 and "no perl is installe
R. Joseph Newton wrote:
> "NIPP, SCOTT V (SBCSI)" wrote:
>
>> Very interesting... Running this script it dies at the 800MB
>> attempt. However, watching this process in top, memory usage is actually
>> double the amount that is being tested. In top, the last memory amount
>> prior to i
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 11:54 AM
To: [EMAIL PROTECTED]
Subject: Frustrated newbie question
Help. I'm a frustrated newbie who wants to use Perl to make my life
easier.
The following simple task is only one smal
Help. I'm a frustrated newbie who wants to use Perl to make my life easier.
The following simple task is only one small part of a program I'm trying to
put together to automate some things I currently do manually.
I have a file whose format looks like this:
name1 name2 name
On Dec 5, 2003, at 6:58 AM, Wiggins d Anconia wrote:
[..]
may get in the way of someone
looking for a distilled IJustWantTheDamnAnswer listing ;-).
[..]
Let's review the bidding a bit so far.
A brief review of the last 45 days will
get you to Jason's original Kvetch about
not quite getting 'perldo
"NIPP, SCOTT V (SBCSI)" wrote:
> Very interesting... Running this script it dies at the 800MB
> attempt. However, watching this process in top, memory usage is actually
> double the amount that is being tested. In top, the last memory amount
> prior to it dying is 1400MB.
>
Could be th
>
> On Dec 4, 2003, at 8:41 PM, R. Joseph Newton wrote:
> > Guay Jean-Sébastien wrote:
> >> ...
> >> Though it doesn't benefit those who didn't post the question
> >> (and answers seldom do, since people who can answer questions
> >> normally don't need the answers),
> >
> > I would not assume tha
Mark Fowler has been doing a grand job of producing an
annual Perl advent calendar. Each door has a different
Perl module behind it. Take a look here:
http://www.perladvent.org/2003/
Cheers,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi!
With this piece of code
foreach $gif (@files){
@gif_parts = split(/_/,$gif);
print "Inserting into id=$gif_parts[0], name=$gif: ";
# Read file into scalar
open(IN, $gif ) or die $!;
binmode(IN);
my $doc_len = read IN, $doc, $max_len;
close(IN);
print qq{$doc_len bytes\n};
my $tmp=; #
37 matches
Mail list logo