The point was that 「say」 will print undefined values without complaining.

Really debug statements should be more like:

    $*STDERR.put: 「%CommandLine<backup_path> = 」, %CommandLine<backup_path>;

Or more succinctly:

    dd %CommandLine<backup_path>;

On Wed, May 27, 2020 at 1:39 AM Peter Pentchev <r...@ringlet.net> wrote:

> On Tue, May 26, 2020 at 07:16:54PM -0700, ToddAndMargo via perl6-users
> wrote:
> > On 2020-05-25 23:42, ToddAndMargo via perl6-users wrote:
> > > HI All,
> > >
> > > I am missing something here:
> > >
> > >
> > > 154:   # figure out the label
> > > 155:   say %CommandLine<backup_path>;
> > > 156:   if "%CommandLine<backup_path>".starts-with( "[" )  &&
> > > 157:      "%CommandLine<backup_path>".contains( "]" ) {
> > >
> > >
> > > BACKUP:\MyDocsBackup\backup1
> [snip]
> >
> >
> > Follow up:
> >
> > This turned ot the be the same issue as the other on:
> >
> > say %CommandLine<backup_path>;
> > BACKUP:\MyDocsBackup\backup1
> >
> > Was not the actual case.  %CommandLine<backup_path>
> > was actually blank.
> >
> > I need to start using `print` instead of `say` to
> > proof things.
> >
> > Thank you all for the help and tips!
>
> This is... strange. Are you really, really sure that the "say" and
> the "print" were really used on the same variable with the same value?
> And the value is supposed to be a (possibly undefined) string?
> And when the value is an undefined string (and nothing changes it after
> "say" is called on it), "say" outputs something that looks like
> a valid path?
>
> This would be really, really strange. I'd say it would qualify as a bug,
> unless there is something else happening there.
>
> Are you really, really, really sure that there is nothing between
> the call to "say" and the place where you use the variable that could
> change the value? Are you also really, really, really sure that you have
> not mistyped one of the names? If so, is there a way you could create
> a minimal example, a short program that, when run on your system, always
> behaves this way, and post it (attach the source file, don't retype it)
> in full, so that people can try to run it on their systems and see if
> "say" really does something strange?
>
> G'luck,
> Peter
>
> --
> Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
> PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
>

Reply via email to