foreach my $filename1 (readdir DIR) {
if ($filename1 =~ /ngc.*\.xml$/i ) {
if (open(NGC_Input-$filename1)) {
$NGC_Update=$filename1;
close (NGC_Input);
}
}
}
}
Someone provided me with the code above to search for any file that has ngc on it. However the code provided also has a specific directory to look for. Is it possbile to remove the directory and just search for file. I tried editing it but nothing seems to work. I m just new in perl so can someone please help??? thank you
Using perl regex 5.8.0
Here is the expr...
(box start .*? (?!description) .*? box end)
with data...
(1)
<!-- GREY BOX START -->
ddsadsa fdsgfdwe ewqewq
dsadsa> dsa ds ds <dsadsa
<!-- GREY BOX END -->
(2)
<!-- GREY BOX START -->
dsa dsadas
dsadsa description.gif dsadsa
dsadf fdfsd
<!-- GREY BOX END -->
(3)
<!-- GREY BOX START -->
ddsad> adadsa dsa <dsadsa>
<!-- GREY BOX END -->
.. current result = 1-3 are matched
*** desired result = 1 and 3 to match by specifically exluding (2) ***
thanks :) the regex is part of a wider system- therefore- i really need a solution to be nailed in rexex only rather than use perl for conditional coding
Placing that into regexbuddy with my test data throws an error on the ?? (i.e. question mark question mark)
sorry- do you have an alternative for this token
major thanks for this- that sure is an ugly expression created with some love :) amazing- thanks a million
I have a good grasp of HTML and a beginners grasp of CSS. I need to develop my languages over the summer. Specifically I might need to have a better grasp of HTML and CSS- completely learn .xml from scratch- maybe perl or python or other such languages. I am going to get a few books and try to learn that way- but I was wondering if an online class might work better? Any tips?
ok i ve got a simple query thats working great in perl
here it is:
$queryx = "SELECT dl from offset_subscription where cust_id= $id and datediff(NOW()-date) < 30";
ok ive got to perform this in php- i tried:
$queryx = "SELECT dl from offset_subscription where cust_id={$id} and datediff(NOW()-date) < 30";
but no love . .
this query works great in my system- so you can possibly see what the env is like:
$query = "SELECT count(*) from dl_vj_subscription where cust_id={$id}";
its something stupid syntaxically that im doing- please help! thanks in advance . .
t
$query = "SELECT count(*) from dl_vj_subscription where cust_id={$id}";
is actually my mdoel- that one is working fine- its the one with the datediff in it that wont work . .
thanks
I need to insert ifdef/endif statements before and after printf statements in a lot of .cpp files. Is this something that can be done with awk- sed- or perl?
Hi- I downloaded and installed ActivePerl for WinXP. When I double click the .pl script I get a command prompt and then it immediately disappears.
When I try to use "perl c:\script.pl" in the command prompt I get this error:
Can t locate Tk.pm in @INC <@INC contains: C:/Perl/site/lib C:/Perl/lib .) at c:\perl\bin\script.pl line 3.
BEGIN failed--compilation aborted at c:\perl\bin\script.pl line 3.
No comments:
Post a Comment