Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
95% Quality Score
Upvotes Received
35
Posts with Upvotes
29
Upvoting Members
13
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
8 Commented Posts
~52.4K People Reached
About Me

Working with Perl for over 15 years.

PC Specs
Working on Windows now (dang!)

148 Posted Topics

Member Avatar for mitchems

It's been a long while since I've been here. I am trying to use Win32 IEAutomation to automate IE to login to SharePoint, read some information, download some files and some other junk. I installed WIN32 IEAutomation. When I run the simple script: use Win32::IEAutomation; my $ie = Win32::IEAutomation->new( visible …

Member Avatar for mitchems
0
543
Member Avatar for sazbaztaz
Member Avatar for TerraBlade
0
1K
Member Avatar for neerajte

IMO it's best to use an array of hashes. Here is a version that works for what you wish. The hashes are put into an array, so each hash is in an array row: [CODE] use strict; use warnings; open(FILE,"<source.txt"); my $x=0; my @keys; my @holder; my @array_hash; while(<FILE>){ chomp; …

Member Avatar for dkhalfe
-1
2K
Member Avatar for niall_heavey

There is no "use Mysql". You have to connect to MySQL through DBI/DBD:Mysql. Since you're on windows, you will want to include the uwinnipeg ppm server in your ppm manager. It depends on the version of perl you are running. Go to the command prompt and type perl -v. to …

Member Avatar for d5e5
0
287
Member Avatar for venkateshvpro

[CODE]Use DBI and DBD::MySQL[/CODE] [url]http://search.cpan.org/~capttofu/DBD-mysql-4.020/lib/DBD/mysql.pm[/url] [url]http://search.cpan.org/~timb/DBI-1.616/DBI.pm[/url]

Member Avatar for mitchems
0
80
Member Avatar for Claude2005

What error message are you getting? The code runs fine on my Windows PC. I didn't have TK installed so I ran: [CODE] ppm install Tk [/CODE] And it installed fine. Then the thing ran fine. BTW, the first line doesn't mean anything in Windows. Windows ignores it. It's only …

Member Avatar for jmichae3
0
753
Member Avatar for tcollins412

print out [iCODE]$ENV{HTTP_COOKIE}[/iCODE] on the page some where.

Member Avatar for d5e5
0
181
Member Avatar for terabyte

It is by default set to newline (\n). But if you undef it, you can slurp in an entire file or data set. [CODE] use strict; use warnings; undef($/); my $fulltext; while(<DATA>){ $fulltext=$_; } $/="\n"; print "$fulltext\n"; __DATA__ Alice was beginning to get very tired of sitting by her sister …

Member Avatar for d5e5
0
352
Member Avatar for abcdef1

Why are you doing this? Why not use [iCODE]use Net::SMTP;[/iCODE]. It's a heck of a lot easier than this and it has a debug mode. [url]http://search.cpan.org/~gbarr/libnet-1.22/Net/SMTP.pm[/url]

Member Avatar for mitchems
0
203
Member Avatar for PhoenixInsilico

This doesn't make any sense. When you say "an unknown number of keys" what are you talking about? I mean: $hash{$key}=$value; Why would you need a push?

Member Avatar for PhoenixInsilico
0
66
Member Avatar for deepakkrish

[url]http://search.cpan.org/~gbarr/Convert-ASN1-0.22/lib/Convert/ASN1.pod[/url] [QUOTE=deepakkrish;1491417]Hi Friends, I got an ASN.1 file .I need to convert it to readable format.is there any way. Thanks in advance, Deepak[/QUOTE]

Member Avatar for mitchems
0
72
Member Avatar for jacksantho
Member Avatar for manju11

Do you have the DBD driver for MySQL installed? Also, can you run a script from teh command line that accesses the database? Can you run that specific cgi script from teh command line as the web server user?

Member Avatar for mitchems
0
231
Member Avatar for vaibhav1983

It sets scope: [CODE] my $var1="world"; { my $var1="hello"; print "$var1 "; } print "$var1\n"; [/CODE] Output: [CODE] hello world [/CODE]

Member Avatar for d5e5
0
338
Member Avatar for singhabsk

Try this: [CODE] use strict; use warnings; open (OUT, ">newfile.txt"); while(<DATA>){ chomp; my ($time,$rest)=split(/ --/,$_,2); my ($hours,$mins,$secs,$usec)=split(/\-/,$time); $hours=~s/^LT//; my $newsec=$hours*3600+$mins*60+$secs; print OUT "LT$newsec --$rest\n"; } close OUT; __DATA__ LT19-10-13-400922 --TID1-3039 1--RequestREGISTER LT19-10-13-405432 --TID1-3039 1--Response100 LT19-10-13-410015 --TID1-3039 1--Response401 LT19-10-13-415481 --TID1-3039 2--RequestREGISTER LT19-10-13-419800 --TID1-3039 2--Response100 [/CODE] The DATA section can be read …

Member Avatar for singhabsk
0
162
Member Avatar for williamshen25

What user does the crontab run as? Does it have the rights to read that file?

Member Avatar for williamshen25
0
112
Member Avatar for markoPerl

Here you go... [CODE] use strict; use warnings; my @array=<DATA>; my $x; for (@array){ chomp; $x++; if(/\<\!\-\-addsearch\-\-\>/){ my @hold; my $count=(@hold)=$_=~/\"/g; if($count>=2){ print "yep line # $x: $_\n"; } } } __DATA__ <html> <body> a line <br> another" with one quote <!--addsearch--> yet one more "and another" <!--addsearch--> not this …

Member Avatar for mitchems
0
112
Member Avatar for boshu

It can be solved, yes. One question for you is - when you say "holds the latest file" do you mean the file name or the file contents?

Member Avatar for k_manimuthu
0
205
Member Avatar for ibdatx
Member Avatar for terabyte

[CODE] use strict; use warnings; my $pattern="1234"; undef($/); my @array; my $count; while(<DATA>){ $count=(@array)=$_=~/$pattern.{1}/gi; } print "$count\n"; print "@array\n"; __DATA__ 12348097790797401234790 87989871234908098098909 87987983412344908098098 [/CODE]

Member Avatar for mitchems
0
168
Member Avatar for terabyte

Strawberry Perl is more cross-platform than active state, from my understanding.

Member Avatar for terabyte
0
151
Member Avatar for 2brite

Some quick questions: is this unix or windows? You have no directive for either on the first line (#!). Is the script executable by the web server? What error message are you getting (look in the web server error log)? What happens when you run the script at the command-line? …

Member Avatar for mitchems
0
122
Member Avatar for koushikG
Member Avatar for d5e5
0
194
Member Avatar for tones1986

A couple of quick questions... 1. Is that one line of the file you are parsing? That is, will the => vm-jetmore] be at the end of a single line or does it span multiple lines? 2. Are those numbers always the same? Or do they change? As for whether …

Member Avatar for d5e5
0
150
Member Avatar for Anthony Cameron

You need to provide more information in order for us (or me anyway) to create such a regex. What does your data look like?

Member Avatar for Anthony Cameron
0
341
Member Avatar for terabyte

RTMF... [CODE] use strict; use warnings; my $x=0; while($x<100){ $x++; print "$x\n"; } print "the loop ran $x times\n"; [/CODE]

Member Avatar for terabyte
0
113
Member Avatar for terabyte

Catalyst is an object-oriented, MVC (Model, Controller, View) architecture for Perl. The reason you use it is for writing big multi-tiered applications. Look into MVC and you can find out why there's an advantage to writing with such an architecture. It is componentized and it is built for testing of …

Member Avatar for mitchems
0
181
Member Avatar for prashant_

Does the apache user have the right to execute the command? You should post the code. You probably want to redirect stdout to a variable too and then print the variable.

Member Avatar for mitchems
0
140
Member Avatar for terabyte

my is a keyword for scope control. It also is required scope-wise for a perl program to pass strict and warnings. [CODE] use strict; use warnings; my $var="one"; print "$var\n"; { my $var="two"; print "$var\n"; } print "$var\n"; [/CODE] output: [CODE] one two one [/CODE]

Member Avatar for mitchems
0
78
Member Avatar for choosenalpha
Member Avatar for The_Result
Member Avatar for callyvan

What a mess! It appears that this script is a front-end to send mail (with attachments). If it were me, I'd scrap the entire thing and use a number of perl modules to accomplish the same task in 1/10th the number of lines. I'd also probably use a templating system …

Member Avatar for d5e5
0
343
Member Avatar for techieinvents
Member Avatar for Anthony Cameron

I'll do it for you, but I don't think you'll be able to turn it in as your work. [CODE] use strict; use warnings; use List::Util qw(sum max min); my @nums=<DATA>; my $sum=sum(@nums); my $avg=$sum/@nums; my $max=max(@nums); my $min=min(@nums); print "Sum: $sum\n"; print "Avg: $avg\n"; print "Min: $min\n"; print "Max: …

Member Avatar for techieinvents
-3
171
Member Avatar for koduruabhinav

It would probably be better/easier to use Net SMTP from CPAN to send the mail. See: [url]http://search.cpan.org/~gbarr/libnet-1.22/Net/SMTP.pm[/url]

Member Avatar for koduruabhinav
0
162
Member Avatar for crazy_perl

Can you provide a few lines of the log file to show the options and what you wish to get out of it?

Member Avatar for sysadm1n
0
86
Member Avatar for bio-grad

A quick clarification... you said " If it does fall within the range, I want it deleted, if it does not then it stays." When I wrote this code, it didn't find records that matched this condition, did you mean " If it does [B]NOT[/B] fall within the range, I …

Member Avatar for d5e5
0
139
Member Avatar for Anthony Cameron

[url]http://search.cpan.org/~shlomif/Statistics-Descriptive-3.0201/lib/Statistics/Descriptive.pm[/url]

Member Avatar for Anthony Cameron
0
3K
Member Avatar for crazy_perl

I still don't get it either. Where does $rec{user} get assigned? Where does it come from? Also, the print $_ is not going to work because you have assigned your foreach to $recd. If $rec{user} is not set you will get the message you are receiving BTW.

Member Avatar for crazy_perl
0
171
Member Avatar for koduruabhinav

Shouldn't the mkdir be "./proj/xy" or "proj/xy" if you wish to create within your home directory? "/proj/xy" would seem to try to create the directory from the root.

Member Avatar for koduruabhinav
0
169
Member Avatar for mitchems

Hi all, There are not too many threads that I start, but I wanted to share with you all something I discovered last week that saved me tons of time. I have a program, which is way to long and complex to post here, that basically opens excel, reads data …

2
145
Member Avatar for BSauer

[CODE] use strict; use warnings; my $other_list=('Hello,World,He,Can,See,Me'); my @other=split(/\,/,$other_list); my %ref; for (@other){ $ref{$_}=1; } while(<DATA>){ chomp; s/^\"//; s/\"$//; my (@comp)=split(/\"\,\"/); for (@comp){ $ref{$_}=0 if(!$ref{$_}); print "$_ is in other list\n" if($ref{$_}); } } __DATA__ "Hello","World","I","Can","See","You" [/CODE] Output: [CODE] Hello is in other list World is in other list Can …

Member Avatar for d5e5
0
1K
Member Avatar for Inês
Member Avatar for hi5.ankit

Neither ssh or a standard c compiler ship with windows. You need a c compiler. You can get one from cygwin.

Member Avatar for richieking
0
159
Member Avatar for Roger101

What is it you have to "do" with each binary number. What is the content/function of the then{}? That makes a huge difference. I feel you have given us only 1/2 the problem. I mean, suppose a binary AND or OR or XOR would work? You haven't told us what …

Member Avatar for d5e5
0
1K
Member Avatar for ghosh22

[CODE] use strict; use warnings; open(FILE,"<example1.txt"); open(OUT,">example2.txt"); my $x=0; while(<FILE>){ chomp; $x++; if($x==1){ print OUT "$_\n"; next; } my ($Compound,$H,$C,$N,$O,$P,$S,$Cl,$Co,$Se,$Class)=split(/\t/); if($C>10 && $P<5){ print OUT "$_\n"; } } close FILE; close OUT; [/CODE]

Member Avatar for richieking
0
120
Member Avatar for nuwan
Member Avatar for richieking
0
2K
Member Avatar for Renuka Devi G
Member Avatar for amittal2089
Member Avatar for Mahaa

Are you sure this is what you want to do? If so, you can control IE through perl... Remember though it is on the CLIENT, not the server. [CODE] use Win32::OLE qw( EVENTS in with valof ); use Win32::OLE::Variant; Win32::OLE->Option( Warn => 0 ); $HomePage = "http://www.google.com/"; $IE = Win32::OLE->GetActiveObject( …

Member Avatar for richieking
0
2K

The End.