=~ /Can't locate (.*) in \@INC/) {
> say "module $1 not found";
> } else {
> say "unknown error: $@"
> };
>
> This isn't 100% safe, but it covers the most common issue. You can read
> more at https://metacpan.org/pod/Try::Tiny#BACK
Hi list,
I need to check the cause of a module loading error.
Currently I'm parsing the text of the thrown exception (see below). This
seems to work, but is there a more idiomatic way?
Best,
Simon
#!/usr/bin/env perl
use 5.020;
use warnings;
use strict;
use Module::Load;
my $module= 'AB::CD';
Hi Omega,
Am 10.07.2016 um 18:58 schrieb Omega -1911:
> Are you certain the font you are using is supported?
You are right: Using the Annotate method with "font => 'DejaVu-Sans'"
made it work.
Looks like their default font doesn't have proper unicode support :/
Thanks for the pointer,
Simon
Hi,
I'm trying to place Unicode annotations on a JPEG file:
#!/usr/bin/env perl
use 5.010;
use warnings;
use strict;
use Image::Magick;
use utf8;
my $image = Image::Magick->new();
$image->Read('file.jpg');
$image->Annotate(text => 'α', pointsize=>'60', geometry=>'+100+100');
$image->Write("/
Am 04.08.2015 um 23:06 schrieb Brandon McCaig:
> Generally I meant that your solution was short and simple enough that
> it probably wasn't worth the extra effort of trying to improve it
> [unless the code was going to be maintained for a long time]. This is
> what I came up with in a few minutes.
Am 30.07.2015 um 20:42 schrieb Brandon McCaig:
> I'll give you my 2 cents for whatever that's worth. >:)
Thanks for your many comments.
The updated full project code is below. Feedback is appreciated. (you
also find this at github.com/simon0x5b/bookmark-djvu)
> I can't help thinking that the e
Hi Gary,
> Unfortunately some strings have a 'S' instead of a 5 or a 'B' instead of a 8
>
> The fields are of the format
>
> Registration XX99XXX
> Stock no XX9
> VIN XX9
>
> I've been experimenting with translate to convert the letters to the correc
Am 21.07.2015 um 22:35 schrieb Jim Gibson:
> That is an unique data structure and transformation requirement (as
most are), so you are not likely to find an existing set of code to do
exactly what you want. However, the transformation should not be too
difficult, so you should try to code up somet
Hi Team,
is there a ready solution to convert an linear array of hashrefs
like this
[ {level => 0, value => "string1"},
{level => 1, value => "string2"},
{level => 2, value => "string3"},
{level => 2, value => "string4"}
]
into the nested data structure
[ {value => "string1",
kids => [
Hi Frank,
when first learning regexps I read the section "In the World of Regular
Expressions" in the Lama-Book [1]. If you find this introduction to
slow, you might also take a look at chromatic's Modern Perl, which is
available for free [2].
Regards, Simon
Am 25
Am 24.03.2015 um 14:03 schrieb Shlomi Fish:
> This can be more idiomatically written as:
>
> $a->[1] <=> $b->[1] or $a->[2] <=> $b->[2]
I agree, a
sort {
$a->[0] <=> $b->[0] or
$a->[1] <=> $b->[1] or
$a->[2] <=> $b->[2]
}
is certainly more readable than the C-style
sort {
Hi Anirban,
first we have to be clear how you want to sort the lines.
Does 10-1 sort before 1-11 ?
Do you want numeric (use <=>) or alphabetic (use cmp) order?
> while (my $line = <$RFH>) {
> chomp($line);
> if ($line =~ m/.*?\-(\d+)\-(\d+).*/) {
> $sequence_no = "
12 matches
Mail list logo