#!/usr/local/bin/perl use warnings; use strict; use utf8; use Encode qw(encode); my $dir = \'/data/Delibes, Léo\';
I have a script in Perl that searches for an error that is in a config file, but it prints out any occurrence of the error.I need to match what is in the config file and print out only the last time t
open(LOG,\"logfile.txt\") or die \"Unable to open $logfile:$!\"; print \"\\n\"; while(<$LOG>){ print if /开发者_如何转开发\\berror\\b/i;
I want to generate some lines of Perl code by using file handling in Perl, for example: open(FILEHANDLE, \">ex.pl\") or die \"cannot open file for reading: $!\";
Im not sure how I can achieve this match expression.Currently I am using, ([A-Za-z0-9-]+) ...which matches letters and numbers.I would also开发者_Python百科 like to match on dashes and underscores