Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • It's actually DBI (or the DBD, I'm not quite sure) which is taking a look at the scalar itself to figure out if it's numerical or not. What you could try is this:

    my $int = 23;
    my $str = "17";

    # force to PV:
    my $int_as_str = "$int";

    # force to IV:
    my $str_as_int = 0+$int;

    # or in your example:
    my $item = $rs->find({
        something => 0+$str,
        another   => "$int",

    Ordinary morality is for ordinary people. -- Aleister Crowley
    • I just had to import things into a database and tried this method to resolve a find_or_create({}).

      It worked perfectly, thank you!