60 PerlMonks - Newest Nodes New nodes appearing on PerlMonks http://perlmonks.org/index.pl?node_id=30175 http://blogs.law.harvard.edu/tech/rss PerlMonks Newest Nodes XML Generator 961 PerlMonks 2015-09-01 10:29:54 rss,clean Tue Sep 1 00:29:54 2015 30 20150901002954 Tue Sep 1 00:29:54 2015 http://perlmonks.org/ Anonymous Monk PDF::API2 module prints junk characters Anonymous Monk http://perlmonks.org/index.pl?node_id=1140635 Hello, When I run the below code, I am getting junk characters as output. Any solution to avoid this? I need last modified date from PDF document properties. I tried stat function but it is g... perlquestion Tue, 01 Sep 2015 09:41:11 +0000 http://perlmonks.org/index.pl?node_id=1140635 1140635 961 2015-09-01 05:41:11 Anonymous Monk For loop not executing all the values parthodas http://perlmonks.org/index.pl?node_id=1140615 I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file_detail.txt has multiple lines. But it is not proceeding to the next value... perlquestion Tue, 01 Sep 2015 06:40:12 +0000 http://perlmonks.org/index.pl?node_id=1140615 1140615 1136129 2015-09-01 02:40:12 parthodas My preferred temperature scale is: chacham http://perlmonks.org/index.pl?node_id=1140638 poll Tue, 01 Sep 2015 10:21:13 +0000 http://perlmonks.org/index.pl?node_id=1140638 1140638 934209 2015-09-01 06:21:13 chacham Re: My preferred temperature scale is: BrowserUk http://perlmonks.org/index.pl?node_id=1140641 Brrrr...Aaaah...Phew. ... note Tue, 01 Sep 2015 10:27:41 +0000 http://perlmonks.org/index.pl?node_id=1140641 1140641 171588 2015-09-01 06:27:41 BrowserUk Re^2: PDF::API2 module prints junk characters Anonymous Monk http://perlmonks.org/index.pl?node_id=1140640 Hello poj, Thanks for your response. When I run your code, I got output like this, ( "ModDate", pack("H*","4a7878cbbb7bff8a4b3b937b7fe3d5e12664278a100905"), "Subject", ... note Tue, 01 Sep 2015 10:25:01 +0000 http://perlmonks.org/index.pl?node_id=1140640 1140640 961 2015-09-01 06:25:01 Anonymous Monk Re^8: Interpolating subroutine call in SQL INSERT INTO SELECT statement shadowsong http://perlmonks.org/index.pl?node_id=1140639 poj, I just managed to get the YAPE::Regex::Explain module downloaded and installed via cpanm (turned out I had some firewall/proxy issues to resolve). This is an awesome ... note Tue, 01 Sep 2015 10:22:39 +0000 http://perlmonks.org/index.pl?node_id=1140639 1140639 1139979 2015-09-01 06:22:39 shadowsong Re: PDF::API2 module prints junk characters poj http://perlmonks.org/index.pl?node_id=1140637 try #!perl use strict; use PDF::API2; use Data::Dump 'pp'; my $file = 'file.pdf'; my $pdf = PDF::API2->open($file); my %h = $pdf->info(); pp $pdf->info; print $h{'ModDate'}; p... note Tue, 01 Sep 2015 10:17:34 +0000 http://perlmonks.org/index.pl?node_id=1140637 1140637 221725 2015-09-01 06:17:34 poj Re^3: Replicating perl instance on AIX 6.1 syphilis http://perlmonks.org/index.pl?node_id=1140636 here is the output of perl-V:config_args I take it that's the "duplicate" of the system perl. I was actually wondering more about the config_args for the system perl - but if you'r... note Tue, 01 Sep 2015 10:09:25 +0000 http://perlmonks.org/index.pl?node_id=1140636 1140636 524150 2015-09-01 06:09:25 syphilis Re^7: Interpolating subroutine call in SQL INSERT INTO SELECT statement poj http://perlmonks.org/index.pl?node_id=1140634 When you get YAPE::Regex::Explain installed the result for your 'old' regex should be The regular expression: (?-imsx:&<a href="?node=%5E%28amp%3B%29">(lt;)|(gt;)</a>) matches as follows: NODE ... note Tue, 01 Sep 2015 09:27:34 +0000 http://perlmonks.org/index.pl?node_id=1140634 1140634 221725 2015-09-01 05:27:34 poj Re^6: rename zip files and folders inside zip files mariog http://perlmonks.org/index.pl?node_id=1140633 I try to do this: #!/usr/bin/perl -w use warnings; use strict; use Archive::Zip qw( :ERROR_CODES ); my @files; @files = ; foreach my $file (@files){ my $zip = Arc... note Tue, 01 Sep 2015 09:00:48 +0000 http://perlmonks.org/index.pl?node_id=1140633 1140633 1096424 2015-09-01 05:00:48 mariog Re^6: Interpolating subroutine call in SQL INSERT INTO SELECT statement shadowsong http://perlmonks.org/index.pl?node_id=1140632 poj - you're right... While testing it I realized I was getting back dodgy results, it turns out what I needed to do was use negative lookahead I ended up changing the valu... note Tue, 01 Sep 2015 08:56:34 +0000 http://perlmonks.org/index.pl?node_id=1140632 1140632 1139979 2015-09-01 04:56:34 shadowsong Re^2: For loop not executing all the values Athanasius http://perlmonks.org/index.pl?node_id=1140631 Hello <a href="?node=GrandFather">GrandFather</a>, Instead you need a while loop which loops while a condition is true. Actually, you need just a little more work than that. You should loop until the file read returns... note Tue, 01 Sep 2015 08:37:43 +0000 http://perlmonks.org/index.pl?node_id=1140631 1140631 968231 2015-09-01 04:37:43 Athanasius Re: help to write perl code poj http://perlmonks.org/index.pl?node_id=1140630 Your program gets stuck in the $sub_line= loop even after finding the INIT_VAL tag, add last; to break out. To see this add $line_count to this line p... note Tue, 01 Sep 2015 08:24:55 +0000 http://perlmonks.org/index.pl?node_id=1140630 1140630 221725 2015-09-01 04:24:55 poj Re^4: Best Perl Books of All Time whittick http://perlmonks.org/index.pl?node_id=1140629 Thanks LanX & Your Mother. I have been messing about with Perl for a good few years now but it really has been just that. I have Picked up a few books (OOP & PBP) to try and get a bit more familiar... note Tue, 01 Sep 2015 08:01:16 +0000 http://perlmonks.org/index.pl?node_id=1140629 1140629 955684 2015-09-01 04:01:16 whittick Re^4: getting content of an https website Datz_cozee75 http://perlmonks.org/index.pl?node_id=1140628 Thanks AM, I got pretty far with this: use strict; use warnings; use feature 'say'; use HTML::Display; use LWP::UserAgent; my $url = 'https://berniesanders.com/issues... note Tue, 01 Sep 2015 07:54:50 +0000 http://perlmonks.org/index.pl?node_id=1140628 1140628 947695 2015-09-01 03:54:50 Datz_cozee75 Re: Counting no of '>' symbol in a file ambrus http://perlmonks.org/index.pl?node_id=1140625 | wc -c ... note Tue, 01 Sep 2015 07:30:29 +0000 http://perlmonks.org/index.pl?node_id=1140625 1140625 295576 2015-09-01 03:30:29 ambrus Re^2: For loop not executing all the values parthodas http://perlmonks.org/index.pl?node_id=1140622 Thanks for the help. Using while loop with defined helped. I tried while, but it was also exiting after the first execution. After putting defined, it is working.... note Tue, 01 Sep 2015 07:25:53 +0000 http://perlmonks.org/index.pl?node_id=1140622 1140622 1136129 2015-09-01 03:25:53 parthodas Re^4: exit this way 1nickt http://perlmonks.org/index.pl?node_id=1140619 Oof. Updated. I ran a little test script but my .perlcriticrc had got borked somehow so perlcritic ran with -5 (why is that the default, anyway?), and the rule has a ... note Tue, 01 Sep 2015 07:11:56 +0000 http://perlmonks.org/index.pl?node_id=1140619 1140619 1130276 2015-09-01 03:11:56 1nickt Re: For loop not executing all the values dsheroh http://perlmonks.org/index.pl?node_id=1140618 Question is cross-posted to https://stackoverflow.com/questions/32325025/all-values-are-not-run-in-a-lo... note Tue, 01 Sep 2015 07:02:39 +0000 http://perlmonks.org/index.pl?node_id=1140618 1140618 163790 2015-09-01 03:02:39 dsheroh Re: For loop not executing all the values GrandFather http://perlmonks.org/index.pl?node_id=1140617 Perl's for loop loops over a list. You have a single item in the list - the first line in the file. Instead you need a while loop which loops while a condition is true. Actually, you need just a li... note Tue, 01 Sep 2015 06:54:39 +0000 http://perlmonks.org/index.pl?node_id=1140617 1140617 461912 2015-09-01 02:54:39 GrandFather Re: For loop not executing all the values Athanasius http://perlmonks.org/index.pl?node_id=1140616 Hello <a href="?node=parthodas">parthodas</a>, You have the wrong kind of loop. Change this: foreach (my $value = ) to this: while (my $value = ) ... note Tue, 01 Sep 2015 06:46:28 +0000 http://perlmonks.org/index.pl?node_id=1140616 1140616 968231 2015-09-01 02:46:28 Athanasius Re: Call for help for CPANTesters kevbot http://perlmonks.org/index.pl?node_id=1140612 The <a href="http://blog.cpantesters.org/diary/199">call for help</a> blog post was updated. Here's the relevant part: UPDATE 2015-08-31: Many thanks to all those who have emailed offering h... note Tue, 01 Sep 2015 05:57:03 +0000 http://perlmonks.org/index.pl?node_id=1140612 1140612 588751 2015-09-01 01:57:03 kevbot Re^3: exit this way Anonymous Monk http://perlmonks.org/index.pl?node_id=1140611 it would be nice to have a "code not reachable" message There isn't such a check for post-exit(), but Perl::Critic definitely has a rule for pre-use strict;. I guess one could write a r... note Tue, 01 Sep 2015 05:54:21 +0000 http://perlmonks.org/index.pl?node_id=1140611 1140611 961 2015-09-01 01:54:21 Anonymous Monk Re: DBI/Oracle Nested SELECT query erix http://perlmonks.org/index.pl?node_id=1140610 possible to do a nested query with DBI/oracle ? Yes. (BTW, a quick google shows me a few examples of oracle FROM subqueries and they all are aliased. Proba... note Tue, 01 Sep 2015 05:47:45 +0000 http://perlmonks.org/index.pl?node_id=1140610 1140610 399498 2015-09-01 01:47:45 erix Re: how to move to the first row of array after passing it through a while loop 1nickt http://perlmonks.org/index.pl?node_id=1140609 Use Text::CSV_XS::fragment(): my @rows = $csv->fragment( *DATA, "col=11;15;18" ); #!/usr/bin/perl use strict; use warnings; use feature qw/ say /; use Tex... note Tue, 01 Sep 2015 05:33:11 +0000 http://perlmonks.org/index.pl?node_id=1140609 1140609 1130276 2015-09-01 01:33:11 1nickt Re^2: exit this way ExReg http://perlmonks.org/index.pl?node_id=1140602 This will probably become a standards issue, and I will probably start putting the exits in. I hate it when I have to abide by standards that I get after others about. I know I would nev... note Tue, 01 Sep 2015 04:50:56 +0000 http://perlmonks.org/index.pl?node_id=1140602 1140602 762144 2015-09-01 00:50:56 ExReg Re: how to move to the first row of array after passing it through a while loop Athanasius http://perlmonks.org/index.pl?node_id=1140601 Hello <a href="?node=wangruonan">wangruonan</a>, Your code has the following skeletal form: my @headers; for $a (@list) { open(my $data, ...); while (my $line = ) { ... note Tue, 01 Sep 2015 04:35:41 +0000 http://perlmonks.org/index.pl?node_id=1140601 1140601 968231 2015-09-01 00:35:41 Athanasius maverick86 maverick86 http://perlmonks.org/index.pl?node_id=1140626 user Tue, 01 Sep 2015 07:46:56 +0000 http://perlmonks.org/index.pl?node_id=1140626 1140626 1140626 2015-09-01 03:46:56 maverick86 perlnewb4life perlnewb4life http://perlmonks.org/index.pl?node_id=1140623 user Tue, 01 Sep 2015 07:26:06 +0000 http://perlmonks.org/index.pl?node_id=1140623 1140623 1140623 2015-09-01 03:26:06 perlnewb4life sbth sbth http://perlmonks.org/index.pl?node_id=1140620 user Tue, 01 Sep 2015 07:16:48 +0000 http://perlmonks.org/index.pl?node_id=1140620 1140620 1140620 2015-09-01 03:16:48 sbth zekkerj zekkerj http://perlmonks.org/index.pl?node_id=1140613 user Tue, 01 Sep 2015 06:18:53 +0000 http://perlmonks.org/index.pl?node_id=1140613 1140613 1140613 2015-09-01 02:18:53 zekkerj ChristianBoussinot ChristianBoussinot http://perlmonks.org/index.pl?node_id=1140607 user Tue, 01 Sep 2015 05:22:13 +0000 http://perlmonks.org/index.pl?node_id=1140607 1140607 1140607 2015-09-01 01:22:13 ChristianBoussinot jimmwayans jimmwayans http://perlmonks.org/index.pl?node_id=1140605 user Tue, 01 Sep 2015 05:13:14 +0000 http://perlmonks.org/index.pl?node_id=1140605 1140605 1140605 2015-09-01 01:13:14 jimmwayans rbrew rbrew http://perlmonks.org/index.pl?node_id=1140603 user Tue, 01 Sep 2015 05:02:34 +0000 http://perlmonks.org/index.pl?node_id=1140603 1140603 1140603 2015-09-01 01:02:34 rbrew