mohad has asked for the wisdom of the Perl Monks concerning the following question:
hello All, I'm new to Perl and have written a small code. Now I want this .pl file to be converted into .exe file so that it can run on any system(only windows) without perl being installed. can someone please guide step by step ?
here is my code:
use strict; use warnings; use Cwd; my @operations = ( { label => 'Harcoded font size value !!', test => sub { $_[0] =~ /font-size\s*(:|=)\s*[^%]+$/ }, }, { label => 'Forced Line height value !!', test => sub { $_[0] =~ /line-height/ }, }, { label => 'position absolute !!', test => sub { $_[0] =~ /position\s*(:|=)\s*absolute/ }, }, ); my $dirpath = getcwd; my @filepaths = glob( "$dirpath/*.css" ); print "no css files\n" unless @filepaths; for my $filepath ( @filepaths ) { print "\n>>> $filepath <<<\n"; $_->{count} = 0 for ( @operations ); # set or reset counts. open my $filehandle, '<', $filepath or die "could not open '$filep +ath': $!"; while ( my $line = <$filehandle> ) { $_->{test}->( $line ) and $_->{count}++ for ( @operations ); # + for each operation, call the test and increment count if it returns +true. } close $filehandle; print "$_->{label} $_->{count} Instance found\n" for ( @operations + ); # for each operation, print the outcome. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting .pl to .exe file
by dasgar (Priest) on Jan 30, 2015 at 06:38 UTC | |
|
Re: Converting .pl to .exe file
by marto (Cardinal) on Jan 30, 2015 at 09:11 UTC | |
|
Re: Converting .pl to .exe file
by regexes (Hermit) on Jan 30, 2015 at 12:34 UTC | |
by bulrush (Scribe) on Nov 09, 2015 at 14:31 UTC | |
|
Re: Converting .pl to .exe file
by mohad (Initiate) on Jan 30, 2015 at 05:27 UTC | |
by Discipulus (Canon) on Jan 30, 2015 at 07:55 UTC | |
|
Re: Converting .pl to .exe file
by mr_mischief (Monsignor) on Jan 30, 2015 at 16:29 UTC |