}
}
+ if ($realpack) {
+ if ($realpack eq 'Regexp') {
+ $out = "$val";
+ $out =~ s,/,\\/,g;
+ return "qr/$out/";
+ }
+ else { # we have a blessed ref
+ $out = $s->{'bless'} . '( ';
+ $blesspad = $s->{apad};
+ $s->{apad} .= ' ' if ($s->{indent} >= 2);
+ }
+ }
+
$s->{level}++;
$ipad = $s->{xpad} x $s->{level};
- if ($realpack) { # we have a blessed ref
- $out = $s->{'bless'} . '( ';
- $blesspad = $s->{apad};
- $s->{apad} .= ' ' if ($s->{indent} >= 2);
- }
if ($realtype eq 'SCALAR') {
if ($realpack) {
SvREFCNT_dec(seenentry);
}
}
-
- (*levelp)++;
- ipad = sv_x(aTHX_ Nullsv, SvPVX(xpad), SvCUR(xpad), *levelp);
- if (realpack) { /* we have a blessed ref */
- STRLEN blesslen;
- char *blessstr = SvPV(bless, blesslen);
- sv_catpvn(retval, blessstr, blesslen);
- sv_catpvn(retval, "( ", 2);
- if (indent >= 2) {
- blesspad = apad;
- apad = newSVsv(apad);
- sv_x(aTHX_ apad, " ", 1, blesslen+2);
+ if (realpack) {
+ if (*realpack == 'R' && strEQ(realpack, "Regexp")) {
+ STRLEN rlen;
+ char *rval = SvPV(val, rlen);
+ char *slash = strchr(rval, '/');
+ sv_catpvn(retval, "qr/", 3);
+ while (slash) {
+ sv_catpvn(retval, rval, slash-rval);
+ sv_catpvn(retval, "\\/", 2);
+ rlen -= slash-rval+1;
+ rval = slash+1;
+ slash = strchr(rval, '/');
+ }
+ sv_catpvn(retval, rval, rlen);
+ sv_catpvn(retval, "/", 1);
+ return 1;
+ }
+ else { /* we have a blessed ref */
+ STRLEN blesslen;
+ char *blessstr = SvPV(bless, blesslen);
+ sv_catpvn(retval, blessstr, blesslen);
+ sv_catpvn(retval, "( ", 2);
+ if (indent >= 2) {
+ blesspad = apad;
+ apad = newSVsv(apad);
+ sv_x(aTHX_ apad, " ", 1, blesslen+2);
+ }
}
}
+ (*levelp)++;
+ ipad = sv_x(aTHX_ Nullsv, SvPVX(xpad), SvCUR(xpad), *levelp);
+
if (realtype <= SVt_PVBM) { /* scalar ref */
SV *namesv = newSVpvn("${", 2);
sv_catpvn(namesv, name, namelen);
STRLEN namelen = strlen(name);
PerlIO *fp;
- if (namelen > 3 && strcmp(name + namelen - 3, ".pm") == 0) {
+ if (namelen > 3 && strEQ(name + namelen - 3, ".pm")) {
SV *pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c');
char *pmc = SvPV_nolen(pmcsv);
Stat_t pmstat;