Help for this page

Select Code to Download


  1. or download this
    #use strict;
    
  2. or download this
        if ($imagefile =~ m/src=\"\//i) {
            $imagefile = "\/" . $';
    ...
        elsif ($imagefile =~ m/src=\"/i) {
            $imagefile = $';
        }
    
  3. or download this
    $imagefile =~ s|src="/?||;
    
  4. or download this
    $imagefile =~ s|src="/?(.*)"$|/$1|;
    
  5. or download this
        # check to see if this image file is in the eMedSample path
        if ($path =~ m/([a-zA-Z0-9\_\-\/])+MMS-Apps\/eMedSample/i) {
            $ImageFilePath = "MMS-Apps/eMedSample/WwwRoot" . $imagefile;
        }
    
  6. or download this
    $path =~ m{[\w/-]+MMS-Apps/eMedSample}i
    
  7. or download this
    use List::Util qw( first );
    
    ...
    my $match = first { $path =~ $_->{pat} } @pattern_prefix;
    $ImageFilePath = $match ? $match->{pre} . $imagefile
                   : "Not sure what the path is here: $path\n";
    
  8. or download this
    # This function in addition to 
    sub ReportFileFound {
        my ($filename, $imagefile, $linenum, $bBuildFilePath) = @_;
    
  9. or download this
    # call as ReportFileFound({ filename  => $fn,
    #                           imagefile => $if,
    ...
       my $args_ref = shift;
    
    # use $args_ref->{filename} for $filename
    
  10. or download this
        my $aLength = $#FinalImageFileList + 1;
    
  11. or download this
        my $aLength = scalar @FinalImageFileList;
    
  12. or download this
            foreach $tmpImageFile (@FinalImageFileList) {
                
    ...
                    $bFound = 1;
                    last;
                }
    
  13. or download this
    $bFound = scalar first { $_ eq $imagePath } @FinalImageFileList;
    
  14. or download this
        open hFile, $filename or die "Failed to open $filename\n";
    
  15. or download this
    open hFile, '<', $filename
        or die "Can't read '$filename': $!\n";
    
  16. or download this
            if ($line =~ m/src="([a-zA-Z0-9\_\-\/])+\.(gif|jp[e]?g|bmp)"/i
    +) {
                $line = $&;
                ReportFileFound($saved_name, $line, $linenum, 1);
            }
    
  17. or download this
            if ($line =~ m{(src="[\w/-]+\.(?:gif|jp[e]?g|bmp)")/i) {
                $line = $1;
                ReportFileFound($saved_name, $line, $linenum, 1);
            }
    
  18. or download this
    sub CheckForImageReferencesInSQL {
        my($server, $username, $password, $DB) = @_;
        use MSSQL::Sqllib;
    
  19. or download this
        foreach $QueryResult (@QueryResult) {
            foreach $row (keys %$QueryResult) {
    
  20. or download this
    @ARGV = (".") unless @ARGV;
    
  21. or download this
        unlink $g_logfile;
    
  22. or download this
        or die "Can't unlink '$g_logfile': $!";
    
  23. or download this
    open hLOGFILE, ">>$g_logfile" or die "Could not open the file $g_logfi
    +le\n";
    
  24. or download this
    open hLOGFILE, '>>', $g_logfile
        or die "Could not append to '$g_logfile': $!\n";