I am trying to create a free standing exe using perl app. I am on old
stuff, perlapp 2.1. Here is the output of what I am doing. Any help is
appreciated.
C:\Perl>perlapp -s=GenDBLoad.pl -f -v -r -c -e=GenDBLoad
Input script name: GenDBLoad.pl
Output exe name: GenDBLoad.exe
Exe Mode: Freestandi
A quick comment as I have not really been following this thread. A report
is basically a formatted file with each row formatted differently based on
something which is always relatively consistent regarding spacing and
offsets. For example, in the report you sent, here are what look like some
si
Sorry about the typos - I had d/b string inserts on my mind. I don't know
where the "=!~" came from - fat fingers I guess.
Carl Jolley <[
You can also try using a regex
$x = '8114,[EMAIL PROTECTED]';
$x =~ /(.*),(.*)/;
print "\n \$1 = $1 , \$2 = $2";
produces
$1 = 8114 , $2 = [EMAIL PROTECTED] # note comma is from print
statement no regex parsing.
I personally like the O'Reilly books myself. I have the Perl CD book shelf
(6 books on a CD) which I reference frequently. Also, learning about
regular expressions will be very useful. I am also reading Mastering
Regular Expressions by Jeffrey Friedl (also through O'Reilly) which I find
very u
You can use the Getopt module
myscript.pl
use Getopt::Long;
use vars qw($date);
GetOptions('D=s' => \$date);
print "\n date is $date";
***
$perl myscript.pl -D="12/21/00"
should print
date is 12/21/00
You can use the regex that was already suggested or use the unpack
statement if the file format will not change. I am not sure which is more
efficient (I think unpack is) or if you even care about efficiency.
H23234 2000.12.11 00.15.00 10.254.345.345
$TMPLT = "A6 A1 A4 A1 A2 A1 A2 A1 A2 A1 A2
Thanks to all for their suggestions. I'd rather use an existing function
than something I wrote.
Is File::Slurp the best option for appending files ??. How will it work
with large files, it that a machine memory limitation since it needs the
file to be in @array? Or does @r = cache to disk if
Try www.ezboard.com. I have used it for some VBA questions, I think it may
have other MS product boards.. It is not as good as this board but what
is?
Here is a general question. Recently there was a discussion here on the
merits of VB vs. Perl. I do not want to rehash that but I do have a
so
I do not think you need to write a regex. I think one of the data modules
can do the conversions for you.
Try Date-Manip using UnixDate ($olddate"%m/%d/%y %r"). This is the
slowest of the Date routines so there may be another one to try.
Scott
Sorry my example got the dates backwards. Try this
use Date::Manip;
&Date_Init ("TZ=EST5EDT");
$sdate = '4/23/1998 4:55:37 PM';
$edate = '6/30/2000';
# -MM-DD HH:MM:SS
$edate = &UnixDate($sdate,"%Y-%m-%d %H:%M:%S");
print "\n start date=$sdate, end date=$edate";
gives
start date=4/23/1
I send mail via perl and use MIME::Lite. It works very well for me. Below
is a test send, you will see where you need to fill in info relative to
your organization.
Good Luck
Scott
use MIME::Lite;
$emailto = '[EMAIL PROTECTED]';
$subj = "-T- Testing 123 testing ";
$errorline
It looks like you got you answer, but here are a couple of other ideas.
Instead of using /i in your regex - you can uc() or lc() the string first -
I think this may be more efficient.
Also, ['html', 'htm', 'doc'] can be written somehting like
/\.htm[l]|\.doc/ (not tested- I think it is the co
Here is something directly from the Perl Cookbook (Ram).
FYI - The O'Reilly Perl CD Bookshelf is a valuable reference source. It
has 6 Perl books on 1 CD with an index for all books.
Chapter 2
A quick suggestion is to put the headlines in a hash and subsequently check
if they exist, i.e. something like the following:
if ( not exists $headlinelist{$headline} ) {
&do _your_stuff;
}
Here is something q&d (quick & dirty) that can be a start and can probably
be done more elegantly.
Scott
while () {
chomp; # eliminate \n
($v1,$v2) = split /\,/; #get variables
next unless ($_);#skip blank lines
$hash{$v1}++;# incr
if you are building for speed avoid $&, $' and $` as they make copies of
the variable being manipulated (see Freidl's Mastering Regular Expressions
ppgs. 273-278 and 281-282).
"you could try changing your substitute to a match and either using parens
with $1 $2 and so on or you could use
$& wit
Instead of worrying about what is & is not installed you can try using
Perlapp to create freestanding exes.
Just a thought
"Mauricio Lairet P."
Try Text::CSV_XS;
Jones Robert Contr 81 CS/SCK
<[
The functionality you are talking about is strictly and Excel issue. Given
that this is a perl mail list the question probably should not be posted
here.
The functionality accomplished by activating the cell where you want the
colums to remain static and then use the tab Window |Freeze Panes
In the debate of editors, I agree - Notepad is not very useful. I'll put
my vote in for UltraEdit32.
"Scott F" <[EMAIL PROTECTED]>
This may be written cleaner, but it works
($tarfile) = $tarfile =~ /\.(.*)$/;
"Purcell, Scott"
With s/// this works
$tarfile =~ s/(.*)\.(.*)$/\2/;
Notice the "\2" vs the $2 since we are using what has been group as a
replacement string
"Purcell, S
I have had success using MIME::Lite. Here is code from a script that works
in production today. Some of the "names
have been changed to protect the innocent".
The script generates a log while processing and then e-mails it to a list
of users.
use MIME::Lite;
.
..
.
sub SendEmail {
my (
Here is a snippet
use Date::Manip;
use MIME::Lite;
use Net::FTP;
#
# set time zone so Unix Date calls work
#
&Date_Init ("TZ=EST5EDT");
use vars qw($user,
$pass,
$server,
$filena,
$timeout,
$passive,
$renwdone,
$pause,
25 matches
Mail list logo