Hi,
I have a csv file. I wanted to do some calculations on some of its fields,
like multiplying the 7th field with the 13th field and overwriting the 13th
field with the answer of my calculation.
Regarding this, can I do the calculations on the input file and overwrite it
after calculating, or I
On Aug 18, 7:58 pm, [EMAIL PROTECTED] (Paul Lalli) wrote:
snip
>
> Is that seriously from the book? UGH. Just declare $array_ref in the
> proper scope, and there's no need to take a reference to a dereference
> of the reference.
>
> while (my $array_ref = $sth1->fetchrow_arrayref) {
> push
On 8/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
snip
> my $cfg = TTXData::get('CONFIG');
snip
> if ($cfg->get('smtptrace')) {
snip
> open STDERR, '>>'.$cfg->get('basedir').'/smtptrace.txt';
snip
> my $s = Net::SMTP->new($smtphost, Debug => $cfg-
> >get('smtptrace') ? 1:0);
Jeff Pang wrote:
2007/8/24, Gunnar Hjalmarsson <[EMAIL PROTECTED]>:
Yoyoyo Yoyoyoyo wrote:
I have a file that I need to use the substitute operator on to get
rid of spaces, and apostrophes and such. The only way I can think of
doing it is this:
1. Open the file and go through it one line at
Ok I figured out a solution:
#!/usr/bin/perl -w
use strict;
use Storable;
my %total_bytes;
my $all = "**all machines**";
my $output_file = 'storage';
if (-e $output_file) {
my $hashref = retrieve $output_file;
%total_bytes = %$hashref;
} else {
print "$output_file has not
Kirk Wythers wrote:
I don't see how $totals{$year}{$month}{count} ++; is holding the count.
Read about the auto-increment operator in "perldoc perlop".
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
2007/8/24, Gunnar Hjalmarsson <[EMAIL PROTECTED]>:
> Yoyoyo Yoyoyoyo wrote:
> > I have a file that I need to use the substitute operator on to get
> > rid of spaces, and apostrophes and such. The only way I can think of
> > doing it is this:
> >
> > 1. Open the file and go through it one line at
Use one-liner Perl to do the replacement without calling 'open' and
'<>' and 'close' directly.
$ perl -pi.bak -e 's/abc/def/' file.txt
2007/8/24, Yoyoyo Yoyoyoyo <[EMAIL PROTECTED]>:
> Hi all,
>
> I have a file that I need to use the substitute operator on to get rid of
> spaces, and apostrophes
Begin forwarded message:
On Aug 23, 2007, at 4:25 PM, Mr. Shawn H. Corey wrote:
# How about?
my ( $year, $month, $doy, $tmax, $tmin, $par, $precip, $NH4, $NO3,
$O3, $CO2, $V1, $V2, $V3, $V4 ) = split;
# You can now store your totals by month as:
$totals{$year}{$month}{tmax} += $tmax;
.
Yoyoyo Yoyoyoyo wrote:
I have a file that I need to use the substitute operator on to get
rid of spaces, and apostrophes and such. The only way I can think of
doing it is this:
1. Open the file and go through it one line at a time with the
diamond operator.
2. Make the substitutions on the
Hi all,
I have a file that I need to use the substitute operator on to get rid of
spaces, and apostrophes and such. The only way I can think of doing it is this:
1. Open the file and go through it one line at a time with the diamond
operator.
2. Make the substitutions on the $_ variable and
2007/8/24, Wagner, David --- Senior Programmer Analyst --- WGO
<[EMAIL PROTECTED]>:
> Rob Dixon pointed me to a module(Win32::Security::NamedObject)
> which works, but when I tried a larger volume, it failed with the
> following:
>
> GetNamedSecurityInfo: The process cannot access the file
On 8/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I've had some success passing various airport codes
> to the other subroutines using functions like lwp::simple, but in this
> one it's not working.
Has anyone suggested using higher-level WWW::Mechanize instead of
low-level LWP::Simple?
#1. I am not a SIR I am a Miss
#2 I was told I could post this...im my other post I had said I didn't
have any
experience with Perl, I didn't have any classes in college and my boss
gave me a side project to do. I'm trying to avoid paying 60 dollars an
hour for troubleshooting.
On Aug 23, 11:40
I'm trying to solve another problem in Intermediate Perl. Here is the
problem:
The program from Exercise 2 in Chapter 5 needs to read the entire
datafile each time it runs. However, the Professor has a new router
logfile each day and doesn't want to keep all that data in one giant
file that take
Thanks to all who replied. I figured reading (and writing) one byte
at a time was the bottleneck, but mostly I'm not familiar with perl's
buffer handling functions/methods... I just knew enough to compare one
byte at a time at least (and I guess even that wasn't optimal since I
was using "eq" inst
Hi,
I'm back for some advice from you helpful folks. I'm pulling weather
data from the web and manipulating it...using airport codes for
various weather data, and I use the same subroutine multiple times for
various airports. I've had some success passing various airport codes
to the other subrouti
On Aug 23, 4:36 pm, [EMAIL PROTECTED] (Randal L. Schwartz) wrote:
> > ""[EMAIL PROTECTED]" == "[EMAIL PROTECTED] com" <[EMAIL PROTECTED]>
> > writes:
>
> "[EMAIL PROTECTED]> Those three things look like sets (unordered) to me not
> lists
> "[EMAIL PROTECTED]> (ordered). The natural dataty
On 8/23/07, Kirk Wythers <[EMAIL PROTECTED]> wrote:
> Sorry for the "not sure where to even begin" nature of this email,
> but I am stuck. I am trying to put together a aggregating script that
> takes daily climate data and produces monthly averages. For example,
> the input file has the form:
>
>
Kirk Wythers wrote:
Sorry for the "not sure where to even begin" nature of this email, but I
am stuck. I am trying to put together a aggregating script that takes
daily climate data and produces monthly averages. For example, the input
file has the form:
---8<--- snip
I need to step through
Sorry for the "not sure where to even begin" nature of this email,
but I am stuck. I am trying to put together a aggregating script that
takes daily climate data and produces monthly averages. For example,
the input file has the form:
year month doy tmax tmin par precip NH4
Rob Dixon pointed me to a module(Win32::Security::NamedObject)
which works, but when I tried a larger volume, it failed with the
following:
GetNamedSecurityInfo: The process cannot access the file because it is
being used by another process. at
C:/Perl/site/lib/Win32/Security/NamedObject.p
Rob Dixon wrote:
John W. Krahn wrote:
In perl you almost *never* need to use the eof() function. That is
usually written as:
while ( read IN, $buffer, $blksize )
{
But even that doesn't report any errors that read() may encounter.
while ( my $read = read IN, $buffer, $blksize )
{
I've installed XAMPP on two Windows machinse for Perl CGI development.
The configuration on both machines should be the same, but on one any
attempt to use the 'require' statement fails with error saying it
"Can't Locate" the specified module.
On the machine where the script run correctly, the con
> -Original Message-
> From: Rob Dixon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 23, 2007 03:38
> To: beginners@perl.org
> Cc: Wagner, David --- Senior Programmer Analyst --- WGO
> Subject: Re: File Creator under WIN32 environment
>
> David Wagner wrote:
> >
> > Need to get t
> ""[EMAIL PROTECTED]" == "[EMAIL PROTECTED] com" <[EMAIL PROTECTED]>
> writes:
"[EMAIL PROTECTED]> Im using Trouble Tickets express and they want to charge me
for
"[EMAIL PROTECTED]> troubleshooting
... so instead, I'll post it here, and try to get free consulting advice from
experts,
> ""[EMAIL PROTECTED]" == "[EMAIL PROTECTED] com" <[EMAIL PROTECTED]>
> writes:
"[EMAIL PROTECTED]> Those three things look like sets (unordered) to me not
lists
"[EMAIL PROTECTED]> (ordered). The natural datatype in Perl to represent a set
of strings
"[EMAIL PROTECTED]> is a hash with
On 8/23/07, Jay Savage <[EMAIL PROTECTED]> wrote:
> That means the regex is actually being compiled twice. It probably
> doesn't, though, make sense to compile the regex before entering the
> loop, so perhaps something like:
Make that *does* make sense.
-- j
--
Here's my code
sorry its long!
its for trouble ticket express
package TTXMail;
use strict;
use TTXData;
use TTXMarkup;
my $hasb64 = 1;
$hasb64 = 0 unless eval "require MIME::Base64";
my $mailer;
my $smtphost;
my $usesmtp;
my $CRLF= "\015\012";
my $doemailfix = 0;
#
On 8/21/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Jeff Pang schreef:
> > Christopher Spears:
>
> >> print "Enter regular expression: ";
> >> chomp(my $regexp = );
> >
> > $regexp = quotemeta($regexp);
>
> Since it specifically asks for a regular expression, I would definitely
> not do quotemeta().
>
Ok..I posted a few weeks ago (ive been so busy at work its not funny)
Im using Trouble Tickets express and they want to charge me for
troubleshooting
but i need to know how to turn on SMTP Trace so I can figure out what
my problem is.
package TTXMail;
use strict;
use TTXData;
use TTXMarkup;
my
John W. Krahn wrote:
In perl you almost *never* need to use the eof() function. That is
usually written as:
while ( read IN, $buffer, $blksize )
{
But even that doesn't report any errors that read() may encounter.
while ( my $read = read IN, $buffer, $blksize )
{
defined $read
On Aug 23, 2:00 am, [EMAIL PROTECTED] (Justin The Cynical) wrote:
> Add the name of the array to a 'master array' list of the machine
> groups
> Then create another array, which would be referenced by the group
> name, and contains the machines associated with the group.
> The script runs if I do
David Wagner wrote:
Need to get the individual who created the file I am looking at.
I am using File::Find to get all files that are 4 days or younger. I can
get all info: Path, file name, file size, date modified easily except
owner. I have looked at the Perl doc ( using AS 5.8.8 build
Hi,
Rather than a dynamic array,you just need to use a correct datastru,a hash.
It's maybe better to write codes as below.
[tmp]$ cat groups.txt
prod01 456 345 234
prod02 789 517 325
prod03 789 517 325
prod04 789 517 325
prod05 789 517 325
[tmp]$ cat test.pl
#!/usr/bin/perl
use strict;
use warni
Greets.
I have a 'config file' that contains a group name (alphanumeric) and
machine name/numbers separated by whitespace. Each group is on it's
own line. The file looks like this:
prod01 456 345 234
prod02 789 517 325
...etc, etc, etc...
What I am attempting to do is:
Put the file contents in
Thank you Chas! I checked that out and found their tutorial which
contained a variation on scandeps which can output files as well as
modules:
scandeps.pl -V -e "use DJabberd.pm"
The PAR functionality looks like it will be helpful to for keeping the
filesystem tight as well.
On 8/22/07, Chas Owe
On Aug 21, 8:37 pm, [EMAIL PROTECTED] (Tony Heal) wrote:
> I want to run a cgi script from another server inside a local cgi page
You could use LWP or (better yet) WWW::Mechanize within your local CGI
to fetch the content of the remote page and then display it from your
local CGI script.
--
The
On Aug 22, 12:21 pm, [EMAIL PROTECTED] wrote:
> I've searche over the web and couldn' find an answer to what I need.
The web is not the best place to look. The first place you should
look for Perl answers is the perldocs themselves. They are very good.
> I need to clean all the ocorrences of th
- Original Message -
From: Mário Gamito <[EMAIL PROTECTED]>
Date: Wednesday, August 22, 2007 4:18 pm
Subject: Help on cleaning strings
To: beginners@perl.org
> I need to clean all the ocorrences of the "##Z/" string (without
> the quotes), from a series of .html files located in a single
40 matches
Mail list logo